POST
https://octopusx.ai
/
mj
/
submit
/
imagine
Midjourney Task Submission
curl --request POST \
  --url https://octopusx.ai/mj/submit/imagine \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "mode": "<string>",
  "prompt": "<string>",
  "base64Array": [
    "<string>"
  ],
  "state": "<string>",
  "notifyHook": "<string>",
  "dimensions": "<string>",
  "botType": "<string>",
  "taskId": "<string>",
  "maskBase64": "<string>",
  "index": 123,
  "motion": "<string>",
  "action": "<string>"
}
'
{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}

Midjourney Task Submission

The Midjourney submission interfaces all belong to the /mj/submit/* group. Different actions use different paths, but the success response style is basically the same.

Common Response

{
  "code": 1,
  "description": "Submit success",
  "result": "1712158011464906"
}
code
integer
Status code. Common values: 1 submission successful, 22 queued, 23 queue full, 24 prompt may contain sensitive words.
description
string
Status description.
result
string | array<string>
Task ID. The upload Discord image interface returns an array of image URLs.

Authentication

Authorization: Bearer YOUR_API_KEY

Submit Imagine Task

POST /mj/submit/imagine
Perform the Imagine action and submit an image generation task.
{
  "mode": "RELAX",
  "prompt": "Cat",
  "base64Array": [
    "data:image/png;base64,xxx1",
    "data:image/png;base64,xxx2"
  ],
  "state": "",
  "notifyHook": ""
}
mode
string
required
Invocation mode, common values are RELAX and FAST.
prompt
string
required
Prompt.
base64Array
array<string>
Base64 array for image references.
state
string
Custom parameter.
notifyHook
string
Callback URL.

Submit Blend Task

POST /mj/submit/blend
Perform the Blend action and submit an image blending task.
{
  "mode": "RELAX",
  "base64Array": [
    "data:image/png;base64,xxx1",
    "data:image/png;base64,xxx2"
  ],
  "dimensions": "SQUARE",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}
mode
string
required
Invocation mode, common values are RELAX and FAST.
base64Array
array<string>
required
Image Base64 array.
dimensions
string
Ratio. Common values: PORTRAIT, SQUARE, LANDSCAPE.
botType
string
Bot type, common values: mj, niji.
notifyHook
string
Callback URL.
state
string
Custom parameter.

Submit Modal Task

POST /mj/submit/modal
When other tasks return code = 21 or require additional prompt input, you can call this interface to continue submitting.
{
  "taskId": "1712204995849323",
  "maskBase64": "data:image/png;base64,xxx1",
  "prompt": "Cat"
}
taskId
string
required
Original task ID.
maskBase64
string
Base64 for the partial redraw mask.
prompt
string
New prompt.

Submit Describe Task

POST /mj/submit/describe
Perform the Describe action and submit an image-to-text task.
{
  "mode": "RELAX",
  "base64": "data:image/png;base64,xxx",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}
The Apifox example you provided uses the base64 field; however, the current project DTO explicitly accepts base64Array. If the upstream channel requires a single-image base64, it is recommended to verify it together with the actual gateway behavior. This document preserves the Apifox invocation style here, but on the project side the main guarantee is that this route exists.

Submit Shorten Task

POST /mj/submit/shorten
Perform the Shorten action.
{
  "mode": "RELAX",
  "prompt": "Cat",
  "botType": "mj",
  "notifyHook": "",
  "state": ""
}

Submit SwapFace Task

POST /mj/insight-face/swap
Submit a SwapFace face-swapping task. The current project code actually parses it in JSON Base64 format:
{
  "sourceBase64": "data:image/png;base64,xxx1",
  "targetBase64": "data:image/png;base64,xxx2"
}
This is different from the multipart/form-data file upload example you provided in Apifox. The current gateway code actually validates sourceBase64 and targetBase64; if they are missing, it will return sour_base64_and_target_base64_is_required.

Submit Video Task

POST /mj/submit/video
The Video interface currently supports two modes:
  1. Generate a video directly based on prompt
  2. Continue generating a video based on an existing taskId
{
  "mode": "FAST",
  "prompt": "a car",
  "taskId": "1712204995849323",
  "index": 1,
  "motion": "low",
  "image": "url",
  "action": "extend",
  "state": "",
  "notifyHook": ""
}
mode
string
required
Invocation mode, common values are RELAX and FAST.
taskId
string
Parent task ID. Used when extending a video based on an existing image.
index
integer
Video index number.
motion
string
Motion intensity, common values: low, high.
action
string
Video task action. In examples, the common value is extend.

Upload Files to Discord

POST /mj/submit/upload-discord-images
Upload images to Discord and return a list of image URLs.
{
  "mode": "RELAX",
  "base64Array": [
    "data:image/png;base64,xxx1"
  ]
}
{
  "code": 1,
  "description": "success",
  "result": [
    "https://cdn.discordapp.com/attachments/..."
  ]
}

Common Local Validation Errors

DescriptionCommon Trigger Condition
bind_request_body_failedInvalid request body format
prompt_is_requiredprompt not provided for Imagine
task_id_is_requiredtaskId not provided when continuing an operation based on a task
action_is_requiredaction missing for continuation-type interfaces
index_is_requiredindex missing for continuation-type interfaces
content_is_requiredcontent missing for simple-change type operations
task_not_foundThe original task does not exist
task_status_not_successWhen the original task must be in a successful state, but it has not succeeded yet
quota_not_enoughInsufficient balance