Midjourney /describe command

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Examples
  5. Try It

Use this endpoint to submit the Midjourney /describe command to your Discord Midjourney channel. Results obtained as a callback via optional parameter replyUrl or by querying jobs/?jobid=jobid endpoint.

Your current Midjourney Settings and Presets will be used, log in to your Discord Midjourney account to adjust them to your liking.

It is important not to use the Midjourney account setup for API access for any purposes other than its intended use, such as executing /imagine or any other Midjourney commands manually or in conjunction with any other automation tools. The useapi.net API internally tracks the usage of the Midjourney account, including the number of currently active executions. Using it for other activities may cause API to function incorrectly.

https://api.useapi.net/v1/jobs/describe

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
    "describeUrl": "URL",
    "discord": "Discord token",
    "server": "Discord server id",
    "channel": "Discord channel id",
    "maxJobs": 3,
    "replyUrl": "Place your call back URL here",
    "replyRef": "Place your reference id here"
}
  • describeUrl is required, must contain valid URL image link.

  • discord, server, channel are required, see Setup Midjourney for details.

  • maxJobs is optional, if not provided defaulted to 3.
    This value should be the same or less than your Midjourney subscription plan Maximum Concurrent Jobs. Currently, it should be 3 or less for Basic and Standard plans and 15 or less for Pro and Mega plans.
    Important Specifying a higher number than supported by your Midjourney subscription will prevent API from functioning properly.

  • replyUrl is optional, place here your callback URL. API will call the provided replyUrl once generation completed.
    Maximum length 1024 characters.
    We recommend using sites like webhook.site to test callback URL functionality.

  • replyRef is optional, place here your reference id which will be stored and returned along with this job response / result.
    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.

    status started
    {
        "jobid": "<jobid>",
        "verb": "describe",
        "status": "started",
        "created": "2023-10-06T18:36:37.963Z",
        "updated": "2023-10-06T18:36:50.401Z",
        "describeUrl": "https://...1.png",
        "channel": "<Discord channel id>",
        "server": "<Discord server id>",
        "maxJobs": 3,
        "messageId": "<Discord message id>",
        "content": "",
        "timestamp": "2023-10-06T18:36:48.875000+00:00",
        "code": 200
    }
    
    status completed
    {
        "jobid": "<jobid>",
        "verb": "describe",
        "status": "completed",
        "created": "2023-10-06T18:36:37.963Z",
        "updated": "2023-10-06T18:36:50.401Z",
        "describeUrl": "https://...1.png",
        "channel": "<Discord channel id>",
        "server": "<Discord server id>",
        "maxJobs": 3,
        "messageId": "<Discord message id>",
        "content": "1️⃣...2️⃣...3️⃣...4️⃣...",
        "timestamp": "2023-10-06T18:36:48.875000+00:00",
        "embeds": [
            {
                "type": "rich",
                "description": "1️⃣...2️⃣...3️⃣...4️⃣...",
                "image": {
                    "url": "https://cdn.discordapp.com/ephemeral-attachments/...",
                    "proxy_url": "https://media.discordapp.net/ephemeral-attachments/...",
                    "width": 980,
                    "height": 1350
                }
            }
        ],    
        "code": 200
    }
    
    Model
    {
        jobid: string,
        verb: 'describe',
        status: 'started' | 'completed',
        created: Date,
        updated: Date,
        describeUrl: string,
        channel: string,
        server: string,
        maxJobs: number,
        messageId: string,
        content: string,
        embeds?: [
            {
                type: string,
                description: string,
                image: {
                    url: string,
                    proxy_url: string,
                    width: number,
                    height: number
                }
            }
        ],       
        timestamp: Date,
        code: 200
    }
    
  • 401 Unauthorized

    {
        "error": "Unauthorized",
        "code": 401
    }
    
  • 412 Precondition Failed

    {
        "error": 
            "<describeUrl | discord | server | channel> is missing" 
            "describeUrl is empty" 
            "GET <url> failed with HTTP status <status>. Response body <body>"
            "<url> unknown mime type",
        "code": 412
    }
    
  • 413 Content Too Large

    {
        "error": "<replyRef | replyUrl> is too long",
        "code": 413
    }
    
  • 422 Unprocessable Content

    URL did not pass the Midjourney content moderation policy.
    If you wish to appeal login to Discord, navigate to the configured API server and channel, locate the moderation message, and proceed with the appeal process. Do not mention the fact that you’re using API for Midjourney request generation as it is prohibited by Midjourney policy and may result in a permanent ban of your Midjourney Discord account.

    {
        "error": "Unable to find posted message, likely moderated or invalid url",
        "jobid": "<jobid>",
        "status": "moderated",
        "code": 422
    }
    
  • 429 Too Many Requests

    API query is full and can not accept new jobs/describe requests. Size of query defined by maxJobs optional parameter. Wait in a loop for at least 10..30 seconds and retry again.

    {
        "error": "Maximum of <maxJobs> jobs executing in parallel supported",
        "executingJobs": [
          "<jobid>",
          "<jobid>",
          "<jobid>"
        ],
        "code": 429
    }
    
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/jobs/describe \
         -d '{"describeUrl": "…", "discord": "…", "server": "…", "channel": "…"}'
    
  • const apiUrl = "https://api.useapi.net/v1/jobs/describe"; 
    const token = "API token";
    const describeUrl = "https://url.1";
    const discord = "Discord token";
    const server = "Discord server id";
    const channel = "Discord channel id";      
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      describeUrl, discord, server, channel 
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    apiUrl = "https://api.useapi.net/v1/jobs/describe" 
    token = "API token"
    describeUrl = "https://url.1"
    discord = "Discord token"
    server = "Discord server id"
    channel = "Discord channel id"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    body = {
        "describeUrl": f"{describeUrl}",
        "discord": f"{discord}", 
        "server": f"{server}", 
        "channel": f"{channel}"
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It