---
title: "Create a Midjourney imagine task"
method: POST
path: "/mj/submit/imagine"
---

# Create a Midjourney imagine task

`POST /mj/submit/imagine`

Submit the primary Midjourney generation request. Poll the returned task id with the fetch endpoint until the task reaches a terminal state.

## Request body

- object
  - `botType` 'MID_JOURNEY' | 'NIJI_JOURNEY' — Bot type to use. `MID_JOURNEY` for Midjourney (default), `NIJI_JOURNEY` for Niji.
  - `prompt` string, required — Text prompt for the generation. Supports standard Midjourney parameters such as `--v`, `--ar`, `--stylize`, etc.
  - `accountFilter` object — Filter which Midjourney account modes may be used for this task.
    - `modes` string[] — Allowed speed modes, e.g. `FAST`, `RELAX`, or `TURBO`.
  - `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`

Task accepted.

- object
  - `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
  - `properties` object
    - `discordChannelId` string
    - `discordInstanceId` string
  - `result` string, required — Task id returned after submission.

---

[API](https://skmtc.net/cometapi/apis/create-api-key.md) · [All operations](https://skmtc.net/cometapi/apis/create-api-key/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cometapi/create-api-key/versions/0863102dbf34/schema)
