Retrieve InsightFaceSwap accounts information

Table of contents

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

Before you start using the API, you must configure at least one InsightFaceSwap Discord account. You may specify multiple InsightFaceSwap accounts, the API will automatically perform load balancing by randomly selecting an account with available credits before making calls to InsightFaceSwap Discord bot.

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

https://api.useapi.net/v1/faceswap/account

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
Responses
  • 200 OK

    {
        "Discord channel A": {
            "server": "Discord server A",
            "channel": "Discord channel A",
            "discord": "Discord token A",
            "credits": {
                "timestamp": "2024-02-01T02:05:24.991000+00:00",
                "total": 50,
                "used": 18
            },
        },
        "Discord channel B": {
            "server": "Discord server B",
            "channel": "Discord channel B",
            "discord": "Discord token B"
        },
        "Discord channel N": {
            "server": "Discord server N",
            "channel": "Discord channel N",
            "discord": "Discord token N",
            "credits": {
                "timestamp": "2024-02-01T03:17:48.159000+00:00",
                "total": 200,
                "used": 115
            }
        }    
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
  [channel: string]: {
    discord: string,
    server: string, 
    channel: string,
    credits: {
      timestamp: string,
      total:  number,
      used: number
    }
  }
}
Examples
  • curl https://api.useapi.net/v1/faceswap/account \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/faceswap/account"; 
    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/v1/faceswap/account"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It