Midjourney Proxy
Call Midjourney through the Midjourney Proxy format. All submit endpoints are POST (except query ones); auth is the same as other endpoints.
Workflow
- Submit a task (
/mj/submit/*) → get a task ID. - Poll (
/mj/task/{id}/fetch) → getstatusandimageUrl. - Optionally upscale / vary / reroll the 4-grid result (
/mj/submit/changeor/mj/submit/action).
Imagine
POST /mj/submit/imaginecurl https://test.kailin.com.cn/mj/submit/imagine \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-token" \
-d '{ "prompt": "a cyberpunk cat, neon light --ar 16:9" }'
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Drawing prompt, MJ flags allowed (--ar, --v, …) |
base64Array | array | No | Reference images (array of Base64) |
notifyHook | string | No | Callback URL (polling also works) |
state | string | No | Custom passthrough field |
Response:
{ "code": 1, "description": "Submitted", "result": "1792xxxx-task-id" }
code: 1 success with result as the task ID; code: 21 means the task needs a /mj/submit/modal confirmation; code: 22 means a duplicate task; code: 9 means queued (result holds the notice).
Query a Task
GET /mj/task/{id}/fetchcurl https://test.kailin.com.cn/mj/task/1792xxxx-task-id/fetch \
-H "Authorization: Bearer sk-your-token"
{
"id": "1792xxxx-task-id",
"action": "IMAGINE",
"status": "SUCCESS",
"progress": "100%",
"imageUrl": "https://cdn.example.com/mj/xxx.png",
"prompt": "a cyberpunk cat, neon light --ar 16:9",
"submitTime": 1730000000000,
"finishTime": 1730000600000
}
| Field | Description |
|---|---|
status | NOT_START / SUBMITTED / IN_PROGRESS / SUCCESS / FAILURE / CANCEL |
imageUrl | Result image URL (returned once SUCCESS) |
failReason | Failure reason (on FAILURE) |
Batch Query
POST /mj/task/list-by-condition{ "ids": ["id1", "id2"] }
Follow-up Actions
Upscale / Variation / Reroll
POST /mj/submit/change{ "taskId": "1792xxxx-task-id", "action": "UPSCALE", "index": 2 }
| Parameter | Description |
|---|---|
action | UPSCALE / VARIATION / REROLL / HIGH_VARIATION / LOW_VARIATION / ZOOM, etc. |
index | Grid position 1–4 (required for UPSCALE / VARIATION) |
customId | Alternatively pass the button customId returned by the task |
Button Actions
POST /mj/submit/actionClicks one of the buttons returned by a task (U/V buttons, Regional, Pan, etc.):
{ "taskId": "1792xxxx-task-id", "customId": "MJ::JOB::upsample::3::uuid" }
Other Submit Endpoints
| Endpoint | Description |
|---|---|
POST /mj/submit/blend | Blend 2–4 images (base64Array, optional dimensions) |
POST /mj/submit/describe | Image to prompt (send base64, returns four candidate prompts) |
POST /mj/submit/modal | Confirm a code: 21 task (taskId + prompt) |
POST /mj/submit/shorten | Prompt analysis and shortening |
POST /mj/submit/simple-change | Quick change: content such as "taskId U2" |
POST /mj/submit/edits | Partial edits |
POST /mj/submit/video | Video generation |
POST /mj/submit/upload-discord-images | Upload images and get reference URLs |
POST /mj/insight-face/swap | Face swap (InsightFace) |
Helper Endpoints
| Endpoint | Description |
|---|---|
GET /mj/task/{id}/image-seed | Get the image seed of a task |
GET /mj/image/{id} | Proxied image access |
tip
Every submit that returns code: 21 must be confirmed via /mj/submit/modal before execution — common for close-up portraits and similar scenes.