Midjourney /imagine command

October 27, 2025

Table of contents

  1. Request Headers
  2. Request Body
  3. Parameters
  4. Responses
  5. Model
  6. Examples
  7. 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.
Responses
  • 200 OK

    Use returned jobid to retrieve job status and results. content contains message generated by Midjourney reflecting current generation parameters and progress.

    If you want to retrieve four separate upscaled images once job completed successfully execute seed_async.

    {
        "jobid": "<jobid>",
        "verb": "imagine",
        "status": "started",
        "created": "2023-09-09T02:04:49.667Z",
        "updated": "2023-09-09T02:04:53.490Z",
        "prompt": "Steampunk cat",
        "discord": "<ABC…secured…xyz>",
        "channel": "<Discord channel id>",
        "maxJobs": 3,
        "replyUrl": "https://webhook.site/abc",
        "replyRef": "<your optional reference id>",
        "messageId": "<Discord message id>",
        "content": "**Steampunk cat --s 750 --v 5.2** - <@Discord user id> (Waiting to start)",
        "timestamp": "2023-09-09T02:04:51.926000+00:00",
        "code": 200
    }
    
  • 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"
    }
    
  • 422 Unprocessable Content

    Moderated message or invalid prompt params, see Midjourney moderation system.

    {
        "error": "Action needed to continue",
        "errorDetails": "Sorry! Our AI moderators feel your prompt might be against our community standards.",
        "jobid": "<jobid>",
        "status": "moderated",
        "code": 422
    }
    
    {
        "error": "Invalid parameter",
        "errorDetails": "Unrecognized parameter(s): `size`",
        "jobid": "<jobid>",
        "status": "moderated",
        "code": 422
    }
    
  • 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"
    }
    
  • 502 Bad Gateway

    Response code 502 means the Midjourney Discord bot did not reply within the allotted time limit. This usually happens when the Discord Gateway API or the Midjourney Discord bot is having issues.
    You can check Discord status and Midjourney Discord server status channel.
    Keep in mind that both links above most often will not reflect an event that has just started.

  • 503 Service Unavailable

    During peak load times, the Discord Midjourney bot on rare occasions responds with the message Failed to process your command :c. You can safely resubmit the same request again.

    {
        "jobid": "<jobid>",
        "verb": "imagine",
        "status": "failed",
        "error": "Discord Agent Status 503",
        "created": "2023-09-09T02:04:49.667Z",
        "updated": "2023-09-09T02:04:53.490Z",
        "prompt": "<prompt>",
        "discord": "<ABC…secured…xyz>",
        "channel": "<Discord channel id>",
        "maxJobs": 3,
        "replyUrl": "https://webhook.site/abc",
        "replyRef": "<your optional reference id>",
        "content": "Failed to process your command :c",
        "messageId": "<Discord message id>",
        "timestamp": "2023-09-09T02:04:51.926000+00:00",
        "code": 503
    }
    
  • 504 Job queued

    Job queued. The API will not be able to track the progress of this job, although it will still be processed by Midjourney. You may want to adjust the maxJobs number to a lower value for the next several minutes.

    You should not receive this error under normal circumstances unless you have specified a maxJobs parameter higher than your Midjourney subscription supports, or if you are using the Midjourney bot outside of API interactions. On occasions when Midjourney is releasing new updates or experiencing technical issues, jobs may be paused for an extended period of time. Our API will mark all jobs running over 30 minutes as failed. When Midjourney comes back online, it will attempt to complete previously paused jobs, and you may encounter a conflict if you try to submit a new job at the same time. Although this happens very rarely, we have decided to add an extra layer to ensure such cases are detected.

    {
        "error": "Job queued",
        "jobid": "<jobid>",
        "status": "failed",
        "code": 504
    }
    
  • 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."
    }
    
  • Real-time SSE streaming (stream: true)

    Returns Content-Type: text/event-stream with live events. See SSE Event Format for details.

  • 201 Created

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

    {
      "jobid": "j1023141520123456789i-u12345-c1234567890123456789-bot:midjourney",
      "verb": "imagine",
      "jobType": "image",
      "status": "created",
      "created": "2025-10-23T14:15:20.123Z",
      "updated": "2025-10-23T14:15:20.456Z",
      "request": {
        "prompt": "a cat in a hat --ar 16:9",
        "stream": false,
        "replyUrl": "https://your-server.com/webhook",
        "replyRef": "your-reference-id"
      }
    }
    
Model

See Job Response Model for complete response structure.

Examples
  • # SSE streaming
    curl -N -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":true}'
    
    # Fire-and-forget with webhook
    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,"replyUrl":"https://your-server.com/webhook"}'
    
  • const token = 'YOUR_API_TOKEN';
    
    // SSE streaming
    const response = await fetch('https://api.useapi.net/v3/midjourney/jobs/imagine', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        prompt: 'a cat in a hat',
        stream: true
      })
    });
    
    const reader = response.body.getReader();
    const decoder = new TextDecoder('utf-8');
    let buffer = '';
    
    while (true) {
      const { done, value } = await reader.read();
      if (done) break;
    
      buffer += decoder.decode(value, { stream: true });
      const lines = buffer.split('\n');
      buffer = lines.pop();
    
      for (const line of lines) {
        if (line.startsWith('data:')) {
          const eventData = JSON.parse(line.slice(5));
          console.log('Event:', eventData);
    
          if (eventData.status === 'completed') {
            console.log('Job completed!', eventData.response);
          }
        }
      }
    }
    
  • import requests
    
    token = 'YOUR_API_TOKEN'
    headers = {
        'Authorization': f'Bearer {token}',
        'Content-Type': 'application/json'
    }
    
    # SSE streaming
    response = requests.post(
        'https://api.useapi.net/v3/midjourney/jobs/imagine',
        headers=headers,
        json={'prompt': 'a cat in a hat', 'stream': True},
        stream=True
    )
    
    for line in response.iter_lines():
        if line:
            line_str = line.decode('utf-8')
            if line_str.startswith('data:'):
                import json
                event_data = json.loads(line_str[5:])
                print('Event:', event_data)
    
                if event_data.get('status') == 'completed':
                    print('Job completed!', event_data.get('response'))
    
Try It