Midjourney API
Access Midjourney through the unified asynchronous API backed by APIMart
Midjourney uses ToAPIs task IDs. Requests require Authorization: Bearer YOUR_API_KEY. If you are in mainland China, use https://toapis.cn as the Base URL instead.
Supported actions:
imagine, blend, describe, edits, upscale, variation, high-variation, low-variation, reroll, zoom, pan, inpaint, modal, video, remix-strong, remix-subtle.
Every submission returns a task ID. Use the query endpoint to retrieve results. You do not need to provide or retain the upstream APIMart task ID.
Endpoints
| Operation | Method and path |
|---|---|
| Default generation | POST /v1/midjourney/generations |
| Specific action | POST /v1/midjourney/generations/{action} |
| Query a task | GET /v1/midjourney/{task_id} |
The default generation endpoint is equivalent to imagine.
Common request fields
modelstringbodyrequiredMust be midjourney.
promptstringbodyText prompt. Required for imagine and edits; optional for modal, which inherits the parent prompt by default.
image_urlsstring[]bodyPublicly accessible image URLs. Use the image upload endpoint first; do not submit base64 directly. Each image must be no larger than 12 MiB.
task_idstringbodyParent task ID for image actions, video, and Remix. The task must belong to the user associated with the current API key.
speedstringbodydefault: relaxrelax, fast, or turbo.
versionstringbodyMidjourney version, such as v8.2, v8.1, v7, or v6.1.
Submit a task
curl --request POST \
--url https://toapis.com/v1/midjourney/generations/imagine \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "midjourney",
"prompt": "a cinematic lighthouse above a stormy sea",
"speed": "fast",
"version": "v8.2"
}'{
"id": "tsk_img_xxx",
"object": "generation.task",
"model": "midjourney",
"status": "queued",
"progress": 0,
"created_at": 1710000000
}APIMart does not provide a cancellation endpoint. ToAPIs does not expose a fabricated cancellation endpoint. Failed tasks follow the standard refund and webhook rules.