Skip to main content
Each way to create a Midjourney task has its own endpoint: /midjourney/imagine generates, /midjourney/blend blends, /midjourney/video animates, and so on. Operations on existing images, such as upscale and variation, all go through /midjourney/action. You submit, get a task ID, then fetch the result. This page walks you through your first set of images.

Generate your first images

Write the prompt the way you would in Midjourney. Parameters such as --ar, --sref, and --niji go straight into it.
bash
You get a task ID back:
If the prompt doesn’t name a version, --v 8.2 (the current Midjourney default) is added. The returned prompt is exactly what was submitted.

Collect the result

Generation is asynchronous. Fetch the task by its ID:
status moves through submitted (queued), in_progress (generating), then success or failure. In fast mode a set of images usually takes about a minute. When it’s done:
  • images holds four separate images, not a stitched grid. Download and use them directly.
  • On failure status is failure, the reason is in fail_reason, and the charge is refunded.
If you’d rather not poll, pass notify_hook (your receiving URL) when you submit. When the task finishes we POST the same body the fetch endpoint returns.

Keep going

actions lists the operations you can run next on this task. Call /midjourney/action with one of them as action, plus task_id; to work on one image, also pass index (which image, starting at 1):
You get a new task ID, fetched the same way. The new task has its own actions, so you can keep chaining: upscale image 2, zoom out on the upscaled image, then turn it into a video.
No more assembling a custom_id from buttons. Any operation listed in actions can be run; anything else returns unsupported_action.

Choose a speed

Pick a speed with the speed parameter. The default is fast:
You can also write --relax, --fast, or --turbo in the prompt as you would in Midjourney. If both are present, the speed parameter wins. Video endpoints don’t support relax.

Choose a version

Add a version parameter at the end of the prompt; without one, V8.2 is used:
edit supports V8.1 and V8.2 only (V8.2 by default), and retexture supports V7 and V6 only. Follow-up operations such as upscale and variation keep the version of the original image.

Two ways to call

The examples above call the endpoints directly. If you already use the unified task API, the model name is midjourney- plus the action name (for example midjourney-imagine, midjourney-upscale), and the parameters go in input without action:
Task IDs work across both: images generated through the unified API can be upscaled with /midjourney/action, and the other way around. Billing is identical.

Next

Midjourney Capabilities and Parameters

Every endpoint, prompt parameters, video, and billing