Midjourney Overview
A summary of Midjourney task submission, task querying, image proxying, and common return codes.
Midjourney Overview
The Midjourney endpoints use their own set of routes and are not mixed with OpenAI Images or the unified video task structure.
- Task submission mainly uses
/mj/submit/*(face swap uses/mj/insight-face/swap) - Task querying mainly uses
/mj/task/* - Public images are available via
/mj/image/{id}(gateway addition, not covered by the doc) - Submission endpoints include
IMAGINE,BLEND,ACTION,MODAL,DESCRIBE,SHORTEN,VIDEO, andSWAP_FACE - Task re-operations all go through
/mj/submit/action; the action types appear in the query endpoint'sactionfield (UPSCALE,VARIATION,REROLL,ZOOM,PAN, etc.)
Task Submission
POST /mj/submit/imagine, /blend, /action, /modal, /describe, /shorten, /video, /upload-discord-images, /insight-face/swap
Task Query
GET /mj/task/{id}/fetch, POST /mj/task/list-by-condition, GET /mj/task/{id}/image-seed
Route List
| Method | Path | Description |
|---|---|---|
POST | /mj/submit/imagine | Submit an Imagine task |
POST | /mj/submit/blend | Submit a Blend task |
POST | /mj/submit/action | Submit an Action task (execute a button action) |
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/insight-face/swap | Submit a SwapFace task (multipart/form-data) |
POST | /mj/submit/upload-discord-images | Upload images to Discord |
GET | /mj/task/{id}/fetch | Query a single task |
POST | /mj/task/list-by-condition | Batch query tasks |
GET | /mj/task/{id}/image-seed | Query the task seed |
GET | /mj/image/{id} | Proxy the task image (not covered by the doc) |
Common Return Codes
A typical submission response looks like this:
{
"code": 1,
"description": "Submit success",
"result": "1712158011464906"
}
code values per the doc (code, description, and result are required response fields):
code | Description |
|---|---|
1 | Submitted successfully |
22 | Queued |
23 | Queue full, please try again later |
24 | prompt may contain sensitive words |
other | Error |
The following status codes are gateway-side additions (not listed in the doc):
code | Description |
|---|---|
21 | Task already exists, usually meaning one is in progress or a result already exists |
4 | Local parameter validation or gateway processing error |
30 | The current group's load is saturated |
The gateway converts some upstream 21 and 22 statuses into success responses. You may therefore see a success response while the task is still effectively "already exists" or "queued". The reliable approach is still to take the task ID from result and query the task status.
Common Field Conventions
| Field | Description |
|---|---|
mode | Default RELAX; RELAX slow mode, FAST fast mode. The gateway also has a TURBO billing mode (not listed in the doc) |
botType | Bot type: mj = MID_JOURNEY, niji = NIJI_JOURNEY (not present on Imagine or Video) |
dimensions | Blend aspect ratio: PORTRAIT (2:3), SQUARE (1:1), LANDSCAPE (3:2) |
notifyHook | Callback URL; the doc schema writes it as notifyhook, which is equivalent; no callback is made when empty |
taskId | ID of the original task, used to continue from an existing task |
customId | Button action identifier, taken from buttons[].customId in the query response and passed to /mj/submit/action |
base64Array | Array of image Base64 strings |
base64 | Single-image Base64 field for Describe |
maskBase64 | Inpainting mask |
state | Custom passthrough field |