Retrieve Riffusion API accounts configuration

February 17, 2025

Table of contents

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

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

This endpoint retrieves the complete list of configured API accounts for Riffusion.

https://api.useapi.net/v1/riffusion/accounts

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

    {
        "e1f3d2a1-5c6b-4d3a-9b7c-0123456789ab": {
            "jwt": {
                "expires_at": 1781234567,                            
                "expires_in": 604800,
                "refresh_token": "…secured…",
                "access_token": "…secured…",
                "expires_at_UTC": "2025-03-18T12:50:45.000Z"
                "token_type": "bearer",
                "user": {
                    "id": "e1f3d2a1-5c6b-4d3a-9b7c-0123456789ab",
                },
            },
            "maxJobs": 6,
            "user_id": "e1f3d2a1-5c6b-4d3a-9b7c-0123456789ab"
        },
         "b511d6f4-1e33-45c3-885d-0fa094dd5d70": {
            "jwt": {
                "expires_at": 1781234765,                            
                "expires_in": 604800,
                "refresh_token": "…secured…",
                "access_token": "…secured…",
                "expires_at_UTC": "2025-04-18T12:50:45.000Z"
                "token_type": "bearer",
                "user": {
                    "id": "b511d6f4-1e33-45c3-885d-0fa094dd5d70",
                },
            },
            "maxJobs": 6,
            "user_id": "b511d6f4-1e33-45c3-885d-0fa094dd5d70"
        }
    }
    
  • 401 Unauthorized

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

    Configuration not found. To create configuration use POST accounts.

Model
{ // TypeScript, all fields are optional
    [user_id: string]: {
        user_id: string
        maxJobs: number
        error: string
        jwt: {
            access_token: string
            token_type: string
            expires_in: number
            expires_at: number
            refresh_token: string
            expires_at_UTC: string
            user: {
                id: string
            }
        }
    }
}
Examples
  • curl https://api.useapi.net/v1/riffusion/accounts \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/riffusion/accounts"; 
    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/riffusion/accounts"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It