Skip to main content

1. Get your API key

Before you call any API, you need a API-KEY.

Create your account

open the API Console. You can sign in with Google.
After your account is created, Midjourney API generates a default API-KEY. This key is used across all Midjourney API endpoints.New accounts also receive 10 quota as trial balance.

2. Add the request header

All requests must include your API key in the header:
API-KEY: YOUR_API_KEY

3. Send your first request

Step 1: Submit a generation request

The example below creates a Midjourney image task.
curl --request POST \
  --url https://api.midjourney-api.com/midjourney/v1/submit-jobs \
  --header 'Content-Type: application/json' \
  --header 'API-KEY: YOUR_API_KEY' \
  --data '
{
  "prompt": "A cute kitten",
  "mode": "fast",
  "hookUrl": "<string>"
}
'

Sample response

{
  "status": "0",
  "message": "success",
  "data": {
    "taskId": "TzmJP821WQM5jHOx7nR7r"
  }
}

Step 2: Fetch the task result

Use the returned jobId to poll the result:
curl --request POST \
  --url https://api.midjourney-api.com/midjourney/v1/job-status \
  --header 'Content-Type: application/json' \
  --header 'API-KEY: YOUR_API_KEY' \
  --data '
{
    "taskIds":["VUtF55IGrp08Pi_GPf3hk","JRX-ATQfkrX04TDIKCip4"]
}
'

Sample response

{
  "data": [
    {
      "taskId": "rffghVAtBr-5lqjhuC8Nv",
      "status": 0
    },
    {
      "taskId": "TzmJP821WQM5jHOx7nR7r",
      "status": 2,
      "createdAt": 1766916846000,
      "failReason": "Invalid User ID or Personalize Code: ``123123``"
    },
    {
      "taskId": "JRTcg7frYrVn4PsnsboH6",
      "status": 1,
      "jobId": "089b3f2e-b120-4c30-8c1e-6bb02851f661",
      "images": [
        "https://cdn.midjourney.com/089b3f2e-b120-4c30-8c1e-6bb02851f661/0_0.png",
        "https://cdn.midjourney.com/089b3f2e-b120-4c30-8c1e-6bb02851f661/0_1.png",
        "https://cdn.midjourney.com/089b3f2e-b120-4c30-8c1e-6bb02851f661/0_2.png",
        "https://cdn.midjourney.com/089b3f2e-b120-4c30-8c1e-6bb02851f661/0_3.png"
      ],
      "prompt": "a dog play with a boy --niji 6 --ar 9:16",
      "mjPrompt": "a dog play with a boy --niji 6 --ar 9:16",
      "createdAt": 1766915367000,
      "meta": {
        "width": 816,
        "height": 1456
      }
    }
  ]
}

Task statuses

StatusMeaning
0In progress
1Completed successfully
2Failed

Need help?