Create or update PixVerse account information

Table of contents

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

For your convenience, you can specify your PixVerse configuration values under your account. If you specify multiple PixVerse accounts, the API will automatically perform load balancing by randomly selecting an account with available capacity before making calls to Discord / PixVerse.

https://api.useapi.net/v1/pixverse/account/channel

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Request Body
{
    "discord": "Discord token",
    "server": "Discord server id",
    "channel": "Discord channel id",
    "maxJobs": 1-10,
}
  • discord, server, channel are required. Please see Setup PixVerse for details.

  • channel value specified in the request body must match the channel value specified in the URL path https://api.useapi.net/v1/pixverse/account/channel.

  • maxJobs is required. Currently, it should be between 1 and 10.

Responses
  • 204 No Content

  • 400 Bad Request

    {
      "error": 
        "Required param discord is missing or empty"
        "Required param server is missing or empty"
        "Required param channel is missing or empty"
        "Required param channel (<channel>) is not valid Discord channel id"
        "Required param channel (<channel>) not matching to /pixverse/account/<channel>"
        "Required param maxJobs is missing or empty"
        "Required param maxJobs <maxJobs> can't be more that <maxConcurrentJobs>"
        "Channel <channel> configuration has same discord value"
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  discord: string, 
  server: string,
  channel: string,
  maxJobs: number,
  error: string,
  errorDetails: string,
  code: number
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/pixverse/account/<channel> \
         -d '{"discord": "…", "server": "…", "channel": "…", "maxJobs": …}'
    
  • const server = "Discord server id";      
    const channel = "Discord channel id";      
    const apiUrl = `https://api.useapi.net/v1/pixverse/account/${channel}`; 
    const token = "API token";
    const discord = "Discord token";
    const maxJobs = 10;
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      discord, server, channel, maxJobs
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    server = "Discord server id"
    channel = "Discord channel id"
    apiUrl = f"https://api.useapi.net/v1/pixverse/account/{channel}" 
    token = "API token"
    discord = "Discord token"
    maxJobs = 10
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    body = {
        "discord": f"{discord}", 
        "server": f"{server}",
        "channel": f"{channel}",
        "maxJobs": maxJobs
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It