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

# Midjourney Overview

> A summary of Midjourney task submission, task querying, image proxying, and common return codes.

# Midjourney Overview

Midjourney-related APIs use a separate set of routes and are not mixed with OpenAI Images or the unified video task structure.

* Task submission mainly uses `/mj/submit/*`
* Task querying mainly uses `/mj/task/*`
* Public images can be accessed via `/mj/image/{id}`
* Common operations include `IMAGINE`, `BLEND`, `DESCRIBE`, `SHORTEN`, `MODAL`, `VIDEO`, `SWAP_FACE`

<CardGroup cols={2}>
  <Card title="Task Submission" icon="wand-sparkles" href="/en/images/midjourney/submit">
    `POST /mj/submit/imagine`, `/blend`, `/modal`, `/describe`, `/shorten`, `/video`, `/upload-discord-images`, `/insight-face/swap`
  </Card>

  <Card title="Task Querying" icon="hourglass" href="/en/images/midjourney/query">
    `GET /mj/task/{id}/fetch`, `POST /mj/task/list-by-condition`, `GET /mj/task/{id}/image-seed`
  </Card>
</CardGroup>

## Route List

| Method | Path                               | Description                     |
| ------ | ---------------------------------- | ------------------------------- |
| `POST` | `/mj/submit/imagine`               | Submit an Imagine task          |
| `POST` | `/mj/submit/blend`                 | Submit a Blend task             |
| `POST` | `/mj/submit/modal`                 | Submit a Modal task             |
| `POST` | `/mj/submit/describe`              | Submit a Describe task          |
| `POST` | `/mj/submit/shorten`               | Submit a Shorten task           |
| `POST` | `/mj/submit/video`                 | Submit a Video task             |
| `POST` | `/mj/submit/upload-discord-images` | Upload images to Discord        |
| `POST` | `/mj/insight-face/swap`            | Submit a SwapFace task          |
| `GET`  | `/mj/task/{id}/fetch`              | Query a single task             |
| `POST` | `/mj/task/list-by-condition`       | Query tasks in batches          |
| `GET`  | `/mj/task/{id}/image-seed`         | Query the task seed             |
| `GET`  | `/mj/image/{id}`                   | Proxy and return the task image |

## Common Return Codes

The common response structure for Midjourney submission APIs is:

```json theme={null}
{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}
```

Common `code` meanings:

| `code` | Description                                                                                        |
| ------ | -------------------------------------------------------------------------------------------------- |
| `1`    | Submission successful                                                                              |
| `21`   | Task already exists, usually indicating an existing task is in progress or a result already exists |
| `22`   | Queued                                                                                             |
| `23`   | The queue is full, please try again later                                                          |
| `24`   | The prompt may contain sensitive words                                                             |
| `4`    | Local parameter validation or gateway processing error                                             |
| `30`   | The current group load is saturated                                                                |

<Info>
  The current gateway converts some upstream `21` and `22` states into success responses back to the client, so in actual use you may see a successful response while the task is still effectively in an "already exists" or "queued" state. The safe approach is still to take the task ID in `result` and query the task status again.
</Info>

## Common Field Conventions

| Field         | Description                                                                            |
| ------------- | -------------------------------------------------------------------------------------- |
| `mode`        | Common values are `RELAX` and `FAST`; the project also includes a `TURBO` billing mode |
| `notifyHook`  | Callback URL; the current project code uses the camelCase form `notifyHook`            |
| `taskId`      | Original task ID, used to continue operations based on an existing task                |
| `base64Array` | Multi-image Base64 array                                                               |
| `maskBase64`  | Inpainting mask                                                                        |
| `state`       | Custom passthrough field                                                               |

## Recommended Reading Order

1. [Midjourney Task Submission](/en/images/midjourney/submit)
2. [Midjourney Task Querying](/en/images/midjourney/query)
3. [Image Series Overview](/en/images/overview)
