Skip to main content
POST
/
mj
/
submit
/
imagine
cURL
curl https://api.cometapi.com/mj/submit/imagine \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "botType": "MID_JOURNEY",
      "prompt": "a paper boat floating on calm water at sunrise --v 6.1",
      "accountFilter": {
        "modes": [
          "FAST"
        ]
      }
    }'
{
  "code": 1,
  "description": "Submission successful",
  "result": "1773314942177684",
  "properties": {
    "discordChannelId": "5e6ca8e1f40e4de6",
    "discordInstanceId": "5e6ca8e1f40e4de6"
  }
}
Use this endpoint to start the main Midjourney workflow. Every later step, including upscale, variation, and custom zoom, begins with a successful imagine task.

What the first response gives you

  • result is the task id you will poll next
  • code can still be a success code even when it is not HTTP-style 200

Core workflow

1

Submit the imagine task

Send the prompt and store the returned task id.
2

Poll until the task finishes

Use Fetch Single Task until the task reaches SUCCESS, MODAL, or FAILURE.
3

Continue with post-processing

When buttons appear, use Action for upscale, variation, reroll, zoom, and similar follow-up operations.

Optional video prompt pattern

If you want motion from a source image, add an image URL plus Midjourney video flags in the prompt, such as --video and --motion.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Body

application/json
prompt
string
required

Text prompt for the generation. Supports standard Midjourney parameters such as --v, --ar, --stylize, etc.

Example:

"a paper boat floating on calm water at sunrise --v 6.1"

botType
enum<string>
default:MID_JOURNEY

Bot type to use. MID_JOURNEY for Midjourney (default), NIJI_JOURNEY for Niji.

Available options:
MID_JOURNEY,
NIJI_JOURNEY
accountFilter
object

Filter which Midjourney account modes may be used for this task.

base64Array
string[]

Base64-encoded reference images. Each item should be a data URI such as data:image/png;base64,xxx.

state
string

Custom state string. Returned as-is in the task result and webhook callback for your own tracking.

Response

200 - application/json

Task accepted.

code
integer
required

Submission status code. 1 = submitted successfully (result carries the task id). 21 = the action opened a confirmation modal; continue with /mj/submit/modal using the returned task id. 4 = parameter error; description explains the cause.

description
string
required
result
string
required

Task id returned after submission.

properties
object