> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openp.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Midjourney & Suno

> How to integrate image-generation and music-generation models

OpenPAI integrates Midjourney and Suno via **Midjourney-Proxy / Plus** and the **Suno API**, using an **asynchronous task** calling model.

## Midjourney

### Available model IDs

| Model ID       | Behavior                                        |
| -------------- | ----------------------------------------------- |
| `mj_imagine`   | Text-to-image, equivalent to Discord `/imagine` |
| `mj_upscale`   | Upscale an image (U1-U4)                        |
| `mj_variation` | Variations (V1-V4)                              |
| `mj_zoom`      | Zoom-out generation                             |
| `mj_blend`     | Blend multiple images                           |
| `mj_describe`  | Reverse-engineer a prompt                       |

### Async flow

<Steps>
  <Step title="Submit a task">
    `POST /mj/submit/imagine` returns `result` (the task ID).
  </Step>

  <Step title="Poll the task">
    `GET /mj/task/{id}/fetch` until `status` is `SUCCESS` or `FAILURE`.
  </Step>

  <Step title="Get the image">
    On success, the `imageUrl` field returns the 2×2 grid PNG link.
  </Step>

  <Step title="Follow-up actions (optional)">
    `POST /mj/submit/change` submits U/V/Reroll, passing `taskId` and `action`.
  </Step>
</Steps>

### Example: text-to-image

```bash theme={null}
curl https://openp.ai/mj/submit/imagine \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A futuristic cyberpunk city at night, neon lights, --ar 16:9 --v 6"
  }'
```

Response:

```json theme={null}
{ "code": 1, "description": "Submitted", "result": "1737200000000000" }
```

Poll:

```bash theme={null}
curl https://openp.ai/mj/task/1737200000000000/fetch \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
```

See the detailed [Midjourney API docs](/en/api-reference/midjourney/imagine).

## Suno (music generation)

### Available model IDs

| Model ID    | Type                       |
| ----------- | -------------------------- |
| `suno_v3.5` | Suno v3.5, up to 2 minutes |
| `suno_v4`   | Suno v4                    |
| `udio_v1`   | Udio v1 (if enabled)       |

### Async flow

```bash theme={null}
# 1. Submit a task
curl https://openp.ai/suno/submit/music \
  -H "Authorization: Bearer $OPENPAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "lo-fi hip hop, rainy night, female vocals, 90bpm",
    "tags": "lofi, hiphop, chill",
    "title": "Rainy Night",
    "model": "suno_v4",
    "make_instrumental": false
  }'
```

```bash theme={null}
# 2. Poll
curl https://openp.ai/suno/fetch/{task_id} \
  -H "Authorization: Bearer $OPENPAI_API_KEY"
```

On success, `audio_url` in the response is a downloadable MP3 link and `video_url` is an animated video.

See the detailed [Suno API docs](/en/api-reference/suno/generate).

## Billing notes

* Midjourney and Suno are **billed per task**, unlike token-based models.
* Failed tasks (upstream errors) are not billed.
* Tasks the user cancels are settled by the resources already consumed.

The specific multipliers shown in [Console → Models](https://openp.ai/dashboard/models) are authoritative.
