Skip to main content

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​

  1. Submit a task (/mj/submit/*) → get a task ID.
  2. Poll (/mj/task/{id}/fetch) → get status and imageUrl.
  3. Optionally upscale / vary / reroll the 4-grid result (/mj/submit/change or /mj/submit/action).

Imagine​

POST /mj/submit/imagine
curl 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" }'
ParameterTypeRequiredDescription
promptstringYesDrawing prompt, MJ flags allowed (--ar, --v, …)
base64ArrayarrayNoReference images (array of Base64)
notifyHookstringNoCallback URL (polling also works)
statestringNoCustom 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}/fetch
curl 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
}
FieldDescription
statusNOT_START / SUBMITTED / IN_PROGRESS / SUCCESS / FAILURE / CANCEL
imageUrlResult image URL (returned once SUCCESS)
failReasonFailure 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 }
ParameterDescription
actionUPSCALE / VARIATION / REROLL / HIGH_VARIATION / LOW_VARIATION / ZOOM, etc.
indexGrid position 1–4 (required for UPSCALE / VARIATION)
customIdAlternatively pass the button customId returned by the task

Button Actions​

POST /mj/submit/action

Clicks 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​

EndpointDescription
POST /mj/submit/blendBlend 2–4 images (base64Array, optional dimensions)
POST /mj/submit/describeImage to prompt (send base64, returns four candidate prompts)
POST /mj/submit/modalConfirm a code: 21 task (taskId + prompt)
POST /mj/submit/shortenPrompt analysis and shortening
POST /mj/submit/simple-changeQuick change: content such as "taskId U2"
POST /mj/submit/editsPartial edits
POST /mj/submit/videoVideo generation
POST /mj/submit/upload-discord-imagesUpload images and get reference URLs
POST /mj/insight-face/swapFace swap (InsightFace)

Helper Endpoints​

EndpointDescription
GET /mj/task/{id}/image-seedGet 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.