Skip to main content

Overview

Midjourney is an async image model for high-quality diffusion generation, source-image-guided generation, region editing, variation, upscaling, reroll, and draft enhancement. Use this page when you are ready to call the API after trying Midjourney in the APIXO playground.

Workflow categories

Do not put Midjourney inline flags such as --ar, --style, or --sref inside prompt. The backend strips prompt text from the first -- onward. Use API fields such as aspect_ratio, stylization, variety, and weirdness instead.

Endpoint and authentication

Base URL:
All requests require your APIXO API key:
Submit requests also require:

Copy-paste async quickstart

This minimal request submits a text-to-image task and returns a taskId.
Successful response:
Save the taskId; you need it to poll for the final result.

Poll for result

Processing response:
Success response:
Failed response:
Parse resultJson after state becomes success:
Use data.supported_actions directly when you want to present follow-up actions to users. It is returned at the same level as resultJson and is only present when follow-up operations are available. The follow-up action set depends on the source task mode: enhance is only returned for successful v7 + draft generation-family results. Follow-up actions that continue from a specific image can include imageIndex_options so clients can ask the user which image to continue from.

Request body

Text-to-image

Image-to-image

Image-edit

Use image-edit when you want to edit a specific region. If mask, canvas, and imgPos are omitted on compatible routes, the backend can auto-fill a full-image edit region from image_urls[0].

Vary

Upscale

Reroll

Enhance

Parameters

string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
object
required
Midjourney input parameters.
text-to-image and image-to-image share the diffusion parameter family. image-to-image requires at least one image reference across image_urls, sref_urls, cref_urls, or oref_urls, while text-to-image treats image_urls as optional image prompts. image-edit is a separate region-editing workflow and uses mask, canvas, imgPos, and optional remixPrompt.

Response format

Submit task response

POST /generateTask/midjourney returns a task ID when the task is accepted:
integer
API status code. 200 means the task was accepted.
string
Human-readable status message.
string
Unique APIXO task identifier used with the status endpoint.

Status response fields

string
Unique APIXO task identifier.
string
Current task state: pending, processing, success, or failed.
string
JSON string containing the generated image URLs. Present when state is success.
array
Optional follow-up actions for successful results. This field is returned at the same level as resultJson in data.
string
Machine-readable failure code. Present when state is failed.
string
Human-readable failure message. Present when state is failed.
integer
Task creation timestamp in Unix milliseconds.
integer
Task completion timestamp in Unix milliseconds. Present after completion.
integer
Processing duration in milliseconds. Present after completion.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
See Webhooks for delivery requirements and retry behavior.

Billing

Midjourney is billed per use. The selected mode and speed determine the unit price. The current public pricing is easiest to understand in two families: For current route and market comparison pricing, see Pricing.

Latency and polling

Actual latency may vary by prompt complexity, mode, selected route, and current queue load.
For high-concurrency production workloads, use callback mode to avoid frequent polling.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

Task failure codes

Common fixes

See Error Codes for the full error reference.