Midjourney
Generate, blend, edit, describe, and extract images with Midjourney.
Get started
Open the Midjourney playground.
Use an Official Group APIPool API key with POST https://app.apipool.dev/v1/images/generations. Set model to midjourney and choose an action. The API returns HTTP 202 and an imgtask_... ID. Query GET /v1/tasks/{id} with the same key until the task reports completed or failed.
curl https://app.apipool.dev/v1/images/generations \
-H "Authorization: Bearer $APIPOOL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"midjourney","action":"imagine","prompt":"A blue ceramic teapot on a gray table in soft studio light","version":"8.2","speed":"relax","size":"1:1"}'curl https://app.apipool.dev/v1/tasks/imgtask_REPLACE_ME \
-H "Authorization: Bearer $APIPOOL_API_KEY"Completed image tasks return a data array with each image's url and expires_at. Save the images before the URLs expire. Query a completed task again for fresh links while its results are retained. Image descriptions are returned in description. Task queries do not incur generation fees.
Actions and pricing
Prices are in US dollars per successful action. A four-image grid is one action. Follow-up actions are billed separately.
| Action | Operation | Relax | Fast | Turbo |
|---|---|---|---|---|
imagine | Generate with optional references | 0.0563 | 0.0688 | 0.125 |
blend | Blend 2–4 reference images | 0.0688 | 0.0688 | 0.125 |
edits | Edit one complete reference image | 0.0688 | 0.0688 | 0.125 |
describe | Describe one image | 0.0688 | 0.0688 | 0.125 |
upscale | Extract one image from a parent task | 0 | 0 | 0 |
variation | Create a variation of one image | 0.0688 | 0.0688 | 0.125 |
reroll | Generate the task again | 0.0688 | 0.0688 | 0.125 |
remix-strong | Strong remix | 0.0688 | 0.0688 | 0.125 |
remix-subtle | Subtle remix | 0.0688 | 0.0688 | 0.125 |
upscale extracts a single image at its existing resolution. Video, HD upscaling, dedicated strong and subtle variation actions, outpainting, panning, inpainting, MODAL follow-ups, Shorten, and Upload are unavailable.
Parameters
action defaults to imagine. speed defaults to relax, with fast and turbo also available. Completion time varies with the queue.
| Parameter | Actions | Accepted values |
|---|---|---|
prompt | imagine, edits, optional for remix | Required for imagine and edits. 1–4,000 characters. Use structured fields for settings. |
image_urls | imagine, blend, edits, describe | Public HTTPS URLs without credentials. Imagine takes 0–4, blend takes 2–4, and edits or describe takes exactly 1. |
version | imagine, edits | Defaults to 8.2. Also accepts 8.1, 7, 6.1, 5.2, and 5.1. |
niji | imagine, edits | Boolean. When true, set version to 7 or 6. |
size | imagine, edits, blend | Aspect ratio, such as 1:1 or 16:9. Each side must be an integer from 1 to 999. |
quality | imagine, edits | Strings "0.25", "0.5", "1", or "2". Some versions restrict combinations. |
seed | imagine, edits | Integer from 0 to 4,294,967,295. |
stylize | imagine, edits | Integer from 0 to 1,000. |
chaos | imagine, edits | Integer from 0 to 100. |
weird | imagine, edits | Integer from 0 to 3,000. |
raw, tile | imagine, edits | Boolean. |
negative_prompt | imagine, edits | Up to 4,000 characters. Use structured fields for settings. |
task_id | upscale, variation, reroll, remix | Completed image task ID under the same account and key. Remix requires an imagine task from v8.1 or v8.2. |
index | upscale, variation, remix | Required integer from 1 to 4, within the number of parent images. Omit for reroll. |
Use public HTTPS URLs for references. Local paths, multipart files, and base64 are unsupported. The API rejects inline -- flags and unlisted fields such as n, repeat, hd, metadata, and custom_id.
Examples
Describe an image.
{
"model": "midjourney",
"action": "describe",
"image_urls": ["https://example.com/photo.png"]
}{
"id": "imgtask_example",
"status": "completed",
"model": "midjourney",
"data": [],
"description": "A blue ceramic teapot on a gray table."
}Extract the second image.
{
"model": "midjourney",
"action": "upscale",
"task_id": "imgtask_parent",
"index": 2
}Remix the first image.
{
"model": "midjourney",
"action": "remix-subtle",
"task_id": "imgtask_parent",
"index": 1,
"prompt": "Keep the composition and make the teapot green."
}Generate with Niji 6.
{
"model": "midjourney",
"action": "imagine",
"prompt": "An anime illustration of a blue teapot",
"version": "6",
"niji": true
}Troubleshooting
- HTTP 400. Check the action, parameter types, reference count, and parent task status. Use the original API key for follow-ups.
- HTTP 401 or 403. Check the API key, its group, and account access.
- HTTP 429. Wait for the interval in
Retry-After. failedtask. Readerror.message. If capacity is temporarily unavailable, try again later.- Submission timeout or
submission_unknown. Check the console for the existing task before submitting again. - Expired links. Query the task for fresh links while its images are retained.
Add funds when your balance is insufficient. Check the request log and wallet activity for actual charges. Free extraction actions also appear in the request log.