Midjourney /imagine command

October 27, 2025

Table of contents

  1. Request Headers
  2. Request Body
  3. Parameters
  4. Response • JSON • stream: false
  5. Response • SSE Stream • stream: true
  6. Model
  7. Examples
  8. Try It

Generate images or videos from text prompts using Midjourney’s /imagine command.

We provide full support for video generation, including all video-specific parameters such as --video, --motion low, --motion high, --raw, --loop, and --end. See official documentation for details.

Your current Midjourney Settings and Presets will be used.

https://api.useapi.net/v3/midjourney/jobs/imagine

Request Headers

Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data (required for Blob content uploads).
# Content-Type: multipart/form-data

Request Body

{
  "prompt": "a cat in a hat --ar 16:9",
  "stream": true,
  "channel": "1234567890123456789",
  "replyUrl": "https://your-server.com/webhook",
  "replyRef": "your-reference-id"
}

Parameters

  • channel is optional. Discord channel ID to use. See GET /accounts for configured channels. If not provided, API automatically selects available channel with capacity. Specify when you want to use a specific configured channel.

  • prompt is required. Midjourney /imagine prompt. Maximum length 5000 characters.

  • stream is optional (default: true).
    • true - Returns Content-Type: text/event-stream with live progress events. See SSE Streaming Guide
    • false - Returns Content-Type: application/json with initial job state. Use GET /jobs/jobid to retrieve updates and results
  • replyUrl is optional. Webhook URL for real-time job event callbacks. If channel has default replyUrl configured, it will be used when job-specific one is not provided. All job events POST-ed to this URL as they occur.
    Overrides channel-level replyUrl if specified.
    Maximum length 1024 characters.

  • replyRef is optional. Your reference ID stored with job.
    Returned in all responses and callbacks as response.replyRef.
    Maximum length 1024 characters.

Response • JSON • stream: false

Response with content-type: application/json.

  • 201 Created

    Job created successfully. Use returned jobid with GET /jobs/jobid to poll status, or wait for webhook callbacks if replyUrl provided.

    {
        "jobid": "j1024181105489769750i-u12345-c1234567890987654321-bot:midjourney",
        "verb": "imagine",
        "jobType": "image",
        "status": "created",
        "created": "2025-10-24T18:11:05.501Z",
        "request": {
            "replyUrl": "https://api-callback.matthieu.leblanc.workers.dev/",
            "replyRef": "2025-10-24T18:11:04.335Z",
            "stream": false,
            "prompt": "cat in the hat"
        }
    }
    
  • 400 Bad Request

    Validation error.

    {
      "error": "Parameter prompt is required"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized"
    }
    
  • 402 Payment Required

    {
      "error": "Account has no subscription or subscription expired"
    }
    
  • 429 Too Many Requests

    Channel at capacity or rate limited. Wait 10-30 seconds and retry.

    {
      "error": "Channel 1234567890123456789 is busy executing 3 image jobs"
    }
    
  • 596 Pending Moderation

    Channel has pending moderation/CAPTCHA. Email notification sent. Log into Discord and address moderation message/CAPTCHA. Execute POST /accounts/channel/reset.

    {
      "error": "All configured Midjourney channels (2) have errors (pending moderation, CAPTCHA, etc.). Please resolve channel issues before making new requests."
    }
    

Response • SSE Stream • stream: true

Returns content-type: text/event-stream with real-time job progress events. See SSE Streaming Guide for implementation details. See Job Response Model for complete job response object structure.

data: {"event":"initialized","message":"Stream initialized","jobId":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","seq":0,"ts":"18:11:25.857"}

data: {"event":"midjourney_created","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"created","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:26.898Z"},"seq":12,"ts":"18:11:26.919"}

data: {"event":"midjourney_progress","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"progress","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:32.286Z","response":{"webhook_id":"936929561302675456","type":20,"content":"**cat in the hat --v 7.0 --s 250** - <@9876543210123456789> (0%) (turbo)","progress_percent":0}},"seq":17,"ts":"18:11:32.297"}

data: {"event":"midjourney_progress","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"progress","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:35.462Z","response":{"webhook_id":"936929561302675456","type":20,"content":"**cat in the hat --v 7.0 --s 250** - <@9876543210123456789> (15%) (turbo)","progress_percent":15}},"seq":24,"ts":"18:11:35.556"}

data: {"event":"midjourney_progress","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"progress","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:36.172Z","response":{"webhook_id":"936929561302675456","type":20,"content":"**cat in the hat --v 7.0 --s 250** - <@9876543210123456789> (38%) (turbo)","attachments":[{"url":"https://cdn.discordapp.com/attachments/1234567890987654321/123456789098765172/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d_grid_0.webp","width":512,"height":512}],"progress_percent":38}},"seq":26,"ts":"18:11:36.190"}

data: {"event":"midjourney_progress","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"progress","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:39.699Z","response":{"webhook_id":"936929561302675456","type":20,"content":"**cat in the hat --v 7.0 --s 250** - <@9876543210123456789> (96%) (turbo)","attachments":[{"url":"https://cdn.discordapp.com/attachments/1234567890987654321/123456789098765842/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d_grid_0.webp","width":512,"height":512}],"progress_percent":96}},"seq":32,"ts":"18:11:39.724"}

data: {"event":"midjourney_completed","job":{"jobid":"j1024181125701303160i-u12345-c1234567890987654321-bot:midjourney","verb":"imagine","jobType":"image","status":"completed","created":"2025-10-24T18:11:25.829Z","request":{"replyUrl":"https://api-callback.matthieu.leblanc.workers.dev/","replyRef":"2025-10-24T18:11:24.573Z","prompt":"cat in the hat"},"updated":"2025-10-24T18:11:42.798Z","response":{"type":0,"content":"**cat in the hat --v 7.0 --s 250** - <@9876543210123456789> (turbo)","components":[{"type":1,"components":[{"type":2,"style":2,"label":"U1","custom_id":"MJ::JOB::upsample::1::xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d"},{"type":2,"style":2,"label":"U2","custom_id":"MJ::JOB::upsample::2::xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d"}]}],"attachments":[{"url":"https://cdn.discordapp.com/attachments/1234567890987654321/123456789098765624/matthieu_leblanc_975_cat_in_the_hat_xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d.png","width":2048,"height":2048}],"buttons":["U1","U2","U3","U4","🔄","V1","V2","V3","V4"],"imageUx":[{"id":1,"url":"https://cdn.midjourney.com/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d/0_0.jpeg"},{"id":2,"url":"https://cdn.midjourney.com/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d/0_1.jpeg"},{"id":3,"url":"https://cdn.midjourney.com/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d/0_2.jpeg"},{"id":4,"url":"https://cdn.midjourney.com/xxxxxxxx-xxxx-xxxx-xxxx-bbd798ffcb5d/0_3.jpeg"}]},"code":200},"seq":34,"ts":"18:11:42.818"}

Model

See Job Response Model for complete job response object structure.

Examples

The examples below show the JSON response format (stream: false). For real-time SSE streaming examples, see the SSE Streaming Guide.

  • curl -H "Authorization: Bearer YOUR_API_TOKEN" \
         -H "Content-Type: application/json" \
         -X POST "https://api.useapi.net/v3/midjourney/jobs/imagine" \
         -d '{"prompt":"a cat in a hat","stream":false}'
    
  • const response = await fetch('https://api.useapi.net/v3/midjourney/jobs/imagine', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        prompt: 'a cat in a hat',
        stream: false
      })
    });
    
    const result = await response.json();
    console.log('Job created:', result.jobid);
    
    // Poll for completion using GET /jobs/jobid
    // Or use webhook with replyUrl parameter
    
  • import requests
    
    response = requests.post(
        'https://api.useapi.net/v3/midjourney/jobs/imagine',
        headers={'Authorization': 'Bearer YOUR_API_TOKEN'},
        json={
            'prompt': 'a cat in a hat',
            'stream': False
        }
    )
    
    result = response.json()
    print('Job created:', result['jobid'])
    
    # Poll for completion using GET /jobs/jobid
    # Or use webhook with replyUrl parameter
    

Try It