Midjourney

Midjourney Task Submission

Submit Midjourney imagine, blend, action, modal, describe, shorten, video, swap face, and Discord image upload tasks.

POSThttps://zx1.deepwl.net/mj/submit/imagine
Request
curl -X POST https://zx1.deepwl.net/mj/submit/imagine \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "RELAX",
    "notifyHook": "",
    "base64Array": [
        "data:image/png;base64,xxx1",
        "data:image/png;base64,xxx2"
    ],
    "prompt": "Cat",
    "state": ""
}'
Response
{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}

The Midjourney submission interfaces all belong to the /mj/submit/* group (face swap uses /mj/insight-face/swap). Different actions use different paths, but the success response style is the same: code / description / result.

Endpoints

MethodPathPurpose
POST/mj/submit/imagineText-to-image / image-to-image (Imagine)
POST/mj/submit/blendBlend images
POST/mj/submit/actionExecute button actions (UPSCALE / VARIATION / REROLL / ZOOM / PAN, etc.)
POST/mj/submit/modalInpainting / ZOOM with an extra prompt (Modal)
POST/mj/submit/describeImage-to-text (Describe)
POST/mj/submit/shortenPrompt analysis (Shorten)
POST/mj/submit/videoVideo generation / extension (Video)
POST/mj/insight-face/swapFace swap (SwapFace, multipart upload)
POST/mj/submit/upload-discord-imagesUpload images to Discord and return their URLs

Request Headers

Authorizationstring必填

Authentication header. Uses a Bearer token, e.g. Bearer YOUR_API_KEY.

Content-Typestring必填

Request content type, must be application/json (the face swap endpoint uses multipart/form-data).

Submit Imagine Task

POST /mj/submit/imagine

Runs an Imagine operation to submit a drawing task.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

promptstring必填

Prompt, e.g. Cat.

base64Arrayarray<string>

Base64 array of reference images, e.g. data:image/png;base64,xxx1.

notifyHookstring

Callback URL. The doc schema writes it as notifyhook, which is equivalent to notifyHook.

statestring

Custom parameter, passed through as-is.

The doc schema does not mark request-body fields as required. The table above marks prompt as required based on gateway-side validation (it returns prompt_is_required when missing). Imagine has no botType field.

Submit Blend Task

POST /mj/submit/blend

Runs a Blend operation to submit a blend task.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

base64Arrayarray<string>必填

Base64 array of images.

dimensionsstring

Aspect ratio. Allowed values: PORTRAIT (2:3), SQUARE (1:1), LANDSCAPE (3:2), e.g. SQUARE.

botTypestring

Bot type: mj for MID_JOURNEY, niji for NIJI_JOURNEY.

notifyHookstring

Callback URL; no callback is made when empty.

statestring

Custom parameter.

Submit Action Task

POST /mj/submit/action

Executes button actions (upscale, variation, reroll, zoom, pan, etc.). customId comes from buttons[].customId returned by the task query endpoint — pass it to this endpoint to trigger the corresponding button.

taskIdstring必填

Task ID.

customIdstring必填

Action identifier, e.g. MJ::JOB::upsample::2::3dbbd469-36af-4a0f-8f02-df6c579e7011.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

botTypestring

Bot type: mj for MID_JOURNEY, niji for NIJI_JOURNEY.

notifyHookstring

Callback URL; no callback is made when empty.

statestring

Custom parameter.

Submit Modal Task

POST /mj/submit/modal

Call this when a task needs an additional prompt (for example, when its status is MODAL) or for inpainting.

taskIdstring必填

Task ID, e.g. 14001934816969359.

maskBase64string

Base64 of the inpainting mask; used when performing inpainting.

promptstring

Prompt; required in most cases.

Submit Describe Task

POST /mj/submit/describe

Runs a Describe operation to submit an image-to-text task.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

base64string

Image Base64 (single image), e.g. data:image/png;base64,xxx.

botTypestring

Bot type: mj for MID_JOURNEY, niji for NIJI_JOURNEY.

notifyHookstring

Callback URL; no callback is made when empty.

statestring

Custom parameter.

The doc uses a single-image base64 field for Describe (there is no base64Array). Some gateway implementations accept base64Array instead — if parameter validation fails, switch to base64.

Submit Shorten Task

POST /mj/submit/shorten

Runs a Shorten operation to analyze and shorten the prompt.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

promptstring必填

Prompt, e.g. Cat.

botTypestring

Bot type: mj for MID_JOURNEY, niji for NIJI_JOURNEY.

notifyHookstring

Callback URL; no callback is made when empty.

statestring

Custom parameter.

Submit Video Task

POST /mj/submit/video

The Video endpoint currently supports two modes:

  1. Generate a video directly from a prompt
  2. Continue from an existing taskId (video extension)
modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

promptstring

Prompt, e.g. Cat; used when generating a video directly.

taskIdstring

ID of the parent video task to operate on.

indexinteger

Index of the video to operate on; required when action is not empty.

motionstring

Motion strength. Allowed values: low, high.

imagestring

First-frame image; accepts url or base64; may be empty when extending.

actionstring

Operation on the video task; allowed value extend. When not empty, index and taskId are required.

statestring

Custom parameter.

notifyHookstring

Callback URL; no callback is made when empty.

Submit SwapFace Task

POST /mj/insight-face/swap

Submits a SwapFace task using multipart/form-data with two images.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

sourcefile必填

Source face image.

targetfile必填

Target image.

The doc uses a multipart/form-data upload (source / target). The gateway also accepts a JSON Base64 form (sourceBase64 / targetBase64); when missing it returns sour_base64_and_target_base64_is_required.

Upload Files to Discord

POST /mj/submit/upload-discord-images

Uploads images to Discord and returns a list of image URLs.

modestring默认值: RELAX

Call mode, default RELAX. RELAX: slow mode; FAST: fast mode.

base64Arrayarray<string>

Base64 array, e.g. data:image/png;base64,xxx1.

Request Examples

Complete call examples for each endpoint; switch between them via the tabs:

Response Examples

The success response below applies to all submission endpoints (for the Discord upload endpoint, result is an array of image URLs).

Response Fields

codeinteger

Status code: 1 submitted successfully, 22 queued, 23 queue full (try again later), 24 prompt may contain sensitive words, other error. The doc marks code, description, and result as required response fields.

descriptionstring

Status description.

resultstring | array<string>

Task ID. The Discord upload endpoint returns an array of image URLs.

Common Local Validation Errors

DescriptionCommon trigger
bind_request_body_failedMalformed request body
prompt_is_requiredprompt missing for Imagine / Shorten
task_id_is_requiredtaskId missing when continuing from a task
action_is_requiredaction missing on a continue-type endpoint
index_is_requiredindex missing on a continue-type endpoint
content_is_requiredcontent missing for simple-change operations (a gateway extension endpoint not covered by the doc)
task_not_foundThe referenced task does not exist
task_status_not_successThe referenced task has not succeeded yet
quota_not_enoughInsufficient balance