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.

ActionOperationRelaxFastTurbo
imagineGenerate with optional references0.05630.06880.125
blendBlend 2–4 reference images0.06880.06880.125
editsEdit one complete reference image0.06880.06880.125
describeDescribe one image0.06880.06880.125
upscaleExtract one image from a parent task000
variationCreate a variation of one image0.06880.06880.125
rerollGenerate the task again0.06880.06880.125
remix-strongStrong remix0.06880.06880.125
remix-subtleSubtle remix0.06880.06880.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.

ParameterActionsAccepted values
promptimagine, edits, optional for remixRequired for imagine and edits. 1–4,000 characters. Use structured fields for settings.
image_urlsimagine, blend, edits, describePublic HTTPS URLs without credentials. Imagine takes 0–4, blend takes 2–4, and edits or describe takes exactly 1.
versionimagine, editsDefaults to 8.2. Also accepts 8.1, 7, 6.1, 5.2, and 5.1.
nijiimagine, editsBoolean. When true, set version to 7 or 6.
sizeimagine, edits, blendAspect ratio, such as 1:1 or 16:9. Each side must be an integer from 1 to 999.
qualityimagine, editsStrings "0.25", "0.5", "1", or "2". Some versions restrict combinations.
seedimagine, editsInteger from 0 to 4,294,967,295.
stylizeimagine, editsInteger from 0 to 1,000.
chaosimagine, editsInteger from 0 to 100.
weirdimagine, editsInteger from 0 to 3,000.
raw, tileimagine, editsBoolean.
negative_promptimagine, editsUp to 4,000 characters. Use structured fields for settings.
task_idupscale, variation, reroll, remixCompleted image task ID under the same account and key. Remix requires an imagine task from v8.1 or v8.2.
indexupscale, variation, remixRequired 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.
  • failed task. Read error.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.