Task submission and polling
Submission endpoints are all asynchronous tasks: after submitting they return atask_id, then you periodically query GET /v1/midjourney/{task_id} for the status until SUCCESS / FAILURE.
- Polling cadence: 3–5s is recommended; higher frequency is pointless and wastes quota.
- Do not block synchronously in a web request waiting for the task to finish — return the
task_idimmediately after submitting and let the frontend poll asynchronously.
Prompt design
A good prompt:- Subject first: lead with the subject, then describe the scene, and put modifiers last.
- Make structured params explicit: using
--ar/--v/--s(or the corresponding body fields) is more controllable than relying on defaults. - Avoid ambiguous words:
photorealisticis clearer thanrealistic.
niji: true + version: "7"; the platform normalizes it to --niji 7, and billing goes through midjourney@imagine-niji7.
Image-guidance best practices
- Compress to < 5 MiB: the platform limit is 12 MiB, but smaller images transfer / process faster.
- PNG / JPG / WebP are all fine; high-quality JPG is recommended.
- A resolution of 1024–2048 px is already enough; higher is wasteful.
- Image weight
iw(0–3, default 1): >1 stays closer to the source image, <1 is more free.
Error handling and retry strategy
Follow-up operation flow
⚠️ After inpaint enters MODAL you must call /modal within 30 minutes, otherwise the backend auto-cancels (CANCEL) and refunds.
Video billing control
- Single segment:
batch_size: 1→ charged 1 ×midjourney@video - Batch of 4 segments:
batch_size: 4→ charged 4 ×midjourney@video - HD single segment:
video_type: "vid_1.1_i2v_720"+batch_size: 1→ charged 1 ×midjourney@video-720p
batch_size=1; only use 4 for batch comparison drafts. Do not default to 4 (it multiplies cost N times).
Concurrency and throughput
- The platform has a per-minute submission cap; exceeding it returns
429, which needs backoff retry. - Actual generation concurrency is determined by system capacity; exceeding it queues; a task staying in
SUBMITTEDfor a long time usually means it is queued. - Always include
sleepwhen polling; do not spin in a tight loop without sleep.