Midjourney Imagine API
POSThttps://api.acedata.cloud/midjourney/imagine
Midjourney image generation API, text-to-image with iterative refinement.
Related Products
Midjourney - Ace Data Cloud
Midjourney image painting platform, directly connected to this API, fast and stable available.
Request Headers
acceptstring
Specify the response format returned by the server.
Please select
authorizationstring
Bearer token
Request Body
modestring
API running mode, optional values are `fast` (quick), `relax` (relaxed), or `turbo` (super fast). V8.1 currently only supports `fast` and `relax`, and does not support `turbo`.
Please select
actionstring
Operation type. Use `generate` for the first generation, and for subsequent operations, use the action values returned in the `actions` field of the response. You can also specify specific operations to process the generated image.
promptstring
English descriptive words (prompts) for generating images.
timeoutnumber
The timeout duration for API response data (seconds).
image_idstring
The ID of the generated image has been created for continuing subsequent operations based on it.
translationboolean
Is automatic translation enabled for non-English prompts, as Midjourney officially only supports English?
Please select
maskstring
URL of the mask image for operation, which can be used for the specific operation `variation_region` (local repainting).
split_imagesboolean
Whether to split the generated image into multiple single images, and return them through the `sub_image_urls` field after splitting. The default is `false`.
Please select
callback_urlstring
Webhook callback URL for asynchronous notifications.
asyncboolean
Whether to process in asynchronous mode. When set to `true`, the interface immediately returns `task_id`, without the need to provide `callback_url`, and then the result can be obtained by polling the corresponding task query interface; if `callback_url` is also provided, the result will be pushed to that callback address.
Please select
versionstring
Midjourney model versions, such as `'8.1'`, `'8'`, `'7'`, `'6.1'`. It is recommended to use the latest version `'8.1'`. V8.1 uses SD/HD resolution tiers for billing.
hdboolean
Whether to enable HD high-definition output. The SD output of V8.1 consumes about 0.8 GPU minutes, while HD (2K) consumes about 1.3 GPU minutes. The HD rules of V8.0 Alpha are different.
Please select
qualitystring
Image generation quality parameters. Midjourney officially does not support the use of `--quality` / `--q` in V8.1; `--q 4` is a feature of older versions like V8.0 Alpha and should not be used with V8.1.
style_referenceboolean
Whether style reference (`--sref`) is used in the prompt. V8.1 supports style reference, and the cost is calculated based on SD/HD resolution tiers, no longer triggering a separate 4x surcharge; the rules for V8.0 Alpha are different.
Please select
moodboardboolean
Is a moodboard reference used in the prompt? V8.1 supports moodboards, and the cost is calculated based on SD/HD resolution tiers, no longer triggering a separate 4x surcharge; the rules for V8.0 Alpha are different.
Please select
Response

Integration guide
Kind reminder: For streaming requests, the above code may not be fully applicable. Please refer to the integration documentation for changes.
Midjourney generation
Allow Use General Balance
When 'Allow General Balance' is enabled, the general balance is used automatically if an app's balance is insufficient.