POST /midjourney/{endpoint}; every operation on an existing image goes through POST /midjourney/action, with action saying what to do. Both return a task ID, and GET /midjourney/task/{task_id} returns the result. If you haven’t made a call yet, start with the Quickstart.
All endpoints
Every endpoint acceptsnotify_hook (a URL we POST the result to when the task finishes). Every endpoint except describe accepts speed (relax / fast / turbo, default fast).
Generate
Work on existing images
CallPOST /midjourney/action with action set to one of the values below, plus task_id (the task to build on). Operations that act on one image also take index: which image, starting at 1. It can be omitted when the task has a single image.
Without
prompt, zoom, pan, and inpaint reuse the original task’s prompt. If you pass a prompt without a version, the original task’s version is added.
Video
To start from your own image, callPOST /midjourney/video. Starting from an image in a task and extending a video are operations on existing tasks, so they go through POST /midjourney/action.
See Video below for the parameters.
Follow-up operations
actions in the fetch result lists the operations you can run next on that task (the values action accepts on /midjourney/action). The rules match the Midjourney web app:
Some images have extra limits:
- V8 HD images (
--hd) can’t be upscaled. Zoom, pan, and inpaint on them render at standard resolution. - V8.1 / V8.2 drafts sometimes come back as a batch of 24 images. A draft batch can only be varied, remixed, enhanced, or rerolled.
- V8 (
--v 8) can only be varied, remixed, animated, or rerolled.
- You can only build on tasks in your own account that have succeeded. Submitting against an unfinished task returns
task_not_finished. indexstarts at 1 and goes up to the number ofimages(or videos, for a video task).- If an image fails content review, its slot in
imagesis an empty string. The other images keep their numbers, and that image can’t be used further. - Videos can’t be rerolled. To try again, call
videowith the same parameters.
Prompt parameters
The prompt goes to Midjourney as written, so the parameters you use in Midjourney work here too:--ar, --v, --niji, --s, --c, --w, --q, --seed, --no, --sref, --oref, --cref, --iw, --p, --raw, --tile, --draft, --hd, and more.
A few rules to know:
- Speed:
--relax,--fast, and--turboare read as thespeedparameter and not sent on. If both are present, thespeedparameter wins. - Version: if no version is given,
--v 8.2(the current Midjourney default) is added. - Not supported:
--repeat(--r) and permutation prompts{a, b}. They turn one request into several tasks; submit them separately. - Video parameters (
--video,--motion,--bs,--loop,--end) only work on the video endpoints. - Reference images: image URLs in the prompt (image prompts at the start, and URLs after
--sref,--cref,--oref) must be publicly downloadable. Weights after a URL (such as::2) aren’t supported and are removed. - Prompts can be up to 6000 characters (letters, spaces, punctuation and CJK characters each count as one). For V8 models, a prompt whose text (the part before the parameters) is under 1024 characters always works. Longer prompts are condensed automatically before generation: normal long descriptions usually work, but repetitive text may be rejected with a 400
The prompt is too long, shorten it to under 1024 characters and try again, and nothing is charged; shorten the text to under 1024 characters.
Image input
images, image, mask, and end_image accept a publicly downloadable image URL or base64 (with or without the data:image/png;base64, prefix).
- PNG, JPEG, GIF, and WebP, up to 20 MB each.
- URLs must be public. Private-network addresses and pages behind a login are refused.
variation or remix.
Video
There are two ways to give the first frame:- A generated image: call
POST /midjourney/actionwithactionset tovideo, plustask_id+index. - Your own image: call
POST /midjourney/videowithimage.
To extend, call
POST /midjourney/action with action set to video-extend, the video task’s task_id, and which video (index). Extensions keep the original resolution and number of videos, add about 4 seconds each time, and can be done up to 4 times.
Video doesn’t support relax.
Billing
Each call is billed once, and failed tasks are refunded. Each capability’s price for each speed is in the price table on its model page; the cases below multiply the price for the speed you use. Speed: already in the price table: relax is 0.4x the fast price and turbo is 2x. Video has no relax, and describe has no speed. Version and quality (imagine, blend, edit, retexture, and reroll):
Working on existing images:
- Variation, upscale, zoom, pan, and enhance on a draft render at full quality and are billed at 1x, with no draft discount.
- Variation on a V8 HD image is 2x, and so is
remixwith--hdin the new prompt. - Zoom, pan, and inpaint are always 1x (they render at standard resolution on HD images).
- A plain
rerollkeeps the original task’s multiplier; a reroll with a new prompt is priced by the new prompt.
resolution 720p is 3.2x, and batch_size 2 or 4 is 2x or 4x. video-extend is priced by the original video’s resolution and number of videos.
Errors
Every error has this shape, and the HTTP status matches the error type:FAQ
Do the /mj/submit/* endpoints still work?
Do the /mj/submit/* endpoints still work?
Yes. Existing integrations don’t need to change. For new integrations we recommend these endpoints: no more assembling a
custom_id from buttons; call /midjourney/action with action, task_id, and index to work on an image; and speed is a request parameter instead of a token setting.Why does index say it's out of range?
Why does index say it's out of range?
index starts at 1 and goes up to the number of images in the task (or videos, for a video task). An upscaled task has a single image, so use 1 or leave index out.Can I upscale a draft (--draft) directly?
Can I upscale a draft (--draft) directly?
A set of four drafts can be upscaled directly and is billed at full quality. You can also
enhance first to regenerate at full quality, then upscale the one you like. A V8.1 / V8.2 batch of 24 drafts can’t be upscaled; enhance it first.Why doesn't an HD image list upscale in actions?
Why doesn't an HD image list upscale in actions?
V8 HD images (
--hd) are already high resolution, and Midjourney doesn’t upscale them further. You can still vary, zoom, or animate them.Can I use the describe output as a prompt?
Can I use the describe output as a prompt?
Yes.
describe returns immediately with the text in descriptions (written in Chinese); pass it to imagine.