Retrieve Midjourney accounts information

December 2023

Table of contents

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

For your convenience, you can specify your Midjourney configuration values under your account so that you no longer need to provide them with every API call. If you specify multiple Midjourney accounts, the API will automatically perform load balancing by randomly selecting an account with available capacity before making calls to Discord / Midjourney.

This endpoint retrieves the complete list of configured accounts for Midjourney.

https://api.useapi.net/v2/account/midjourney

Request Headers
Authorization: Bearer {API token}
Responses
  • 200 OK

    {
        "Discord channel A": {
            "channel": "Discord channel A",
            "discord": "Discord token A",
            "server": "Discord server A",
            "maxJobs": 1-15
        },
        "Discord channel B": {
            "channel": "Discord channel B",
            "discord": "Discord token B",
            "server": "Discord server B",
            "maxJobs": 1-15
        },
        "Discord channel N": {
            "channel": "Discord channel N",
            "discord": "Discord token N",
            "server": "Discord server N",
            "maxJobs": 1-15
        }    
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
  • 404 Not Found

    Configuration not found. To create configuration use account/midjourney/channel.

Model
{ // TypeScript, all fields are optional
  [channel: string]: {
    discord: string, 
    server: string,
    channel: string,
    maxJobs: number,
    pendingModMessage: string
  }
}
Examples
  • curl https://api.useapi.net/v2/account/midjourney \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v2/account/midjourney"; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v2/account/midjourney"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It