midjourneyapi.ai

API reference

Authenticate, submit a generation, and follow it through completion.

Quickstart

Send your API key as a Bearer token. Keep it on your server and give every submission a unique idempotency key so a network retry cannot create a duplicate job. Fast and Relax cost 1 credit per generation; Turbo costs 2. Batches cost the sum of their prompts. Each generation returns four images.

curl --request POST https://api.midjourneyapi.ai/v1/generate \  --header "Authorization: Bearer $MIDJOURNEY_API_KEY" \  --header 'Content-Type: application/json' \  --header "Idempotency-Key: gen_$(uuidgen)" \  --data '{  "prompt": "A quiet observatory above the clouds",  "mode": "fast",  "config": {    "aspectRatio": "1:1"  }}'

Generation lifecycle

  1. Submit

    POST a prompt and save the returned job ID.

  2. Poll

    Check status until the job succeeds or reaches a final error.

  3. Download

    Read the artifact manifest, then fetch the image you need.

Endpoints

Customer API endpoints
MethodPathPurpose
POST/v1/generateSubmit one generation.
GET/v1/status/:jobIdRead the current generation state.
GET/v1/result/:jobIdRead the verified result when the job succeeds.
GET/v1/artifacts/:jobIdList the generated image artifacts.
GET/v1/events/:jobIdInspect durable lifecycle events.
GET/v1/historyList your account's generations, newest first.