Skip to main content

Submit Imagine Task

POST /mj/submit/imagine
Submit a Midjourney Imagine task to generate images based on a prompt.

Request Parameters

ParameterTypeRequiredDescription
botTypestringNoBot type: MID_JOURNEY (default) or NIJI_JOURNEY
promptstringYesPrompt, supports native Midjourney syntax (e.g. --ar 16:9 --v 6)
base64ArrayarrayNoArray of Base64-encoded reference images for image-guided generation
notifyHookstringNoCallback URL for task status changes
statestringNoCustom state information, returned as-is in callbacks

Request Examples

curl -X POST https://crazyrouter.com/mj/submit/imagine \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "botType": "MID_JOURNEY",
    "prompt": "a beautiful sunset over the ocean, cinematic lighting --ar 16:9 --v 6",
    "notifyHook": "",
    "state": ""
  }'

Response Example

{
  "code": 1,
  "description": "Submitted successfully",
  "result": "task_1234567890",
  "properties": {}
}
FieldDescription
codeStatus code, 1 means success, 22 means queued
descriptionStatus description
resultTask ID, used for subsequent queries

Request with Reference Images

Use base64Array to pass reference images:
cURL
curl -X POST https://crazyrouter.com/mj/submit/imagine \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "botType": "MID_JOURNEY",
    "prompt": "a cat in the style of the reference image --v 6",
    "base64Array": [
      "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg..."
    ]
  }'

Using Niji Journey

Set botType to NIJI_JOURNEY to use the Niji model for anime-style images:
{
  "botType": "NIJI_JOURNEY",
  "prompt": "a cute anime girl with blue hair, cherry blossoms --niji 6"
}
After successful submission, a task ID is returned. Use the Query Task Status endpoint to get the generation result.
Images in base64Array increase the request payload size. It is recommended to keep each image under 4MB.