Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.agipower.ai/llms.txt

Use this file to discover all available pages before exploring further.

Get PAYG Balance

Encountering errors? See the API Error Codes Reference for a complete list of error types and troubleshooting steps.
GET https://api.agipower.ai/v1/management/payg/balance
Returns the Pay As You Go credit balance for the current account, including the total balance and a breakdown by credit source.

Authentication

Authorization Header Required

Authorization: Bearer <AGIPower_MANAGEMENT_API_KEY>
  • Name: Authorization
  • Format: Bearer &lt;API_KEY&gt;
  • Description: A Management API Key created in the AGIPower Console
This endpoint only accepts Management API Keys. Standard API Keys are not supported.

Rate Limiting

Each endpoint has its own independent rate limit counter. The maximum number of requests per minute is configured at the platform level. Exceeding the limit returns a 422 error.

Returns

data.currency string

Currency unit. Always "usd".

data.total_credits number

The account’s current total PAYG credit balance (USD).

data.top_up_credits number

Credits obtained through direct top-ups (USD).

data.bonus_credits number

Credits obtained through bonuses, gifts, or promotions (USD).
total_credits = top_up_credits + bonus_credits (minor floating-point differences may apply).

GET /v1/management/payg/balance

curl https://api.agipower.ai/v1/management/payg/balance \
  -H "Authorization: Bearer $AGIPower_MANAGEMENT_API_KEY"
import requests

response = requests.get(
    "https://api.agipower.ai/v1/management/payg/balance",
    headers={"Authorization": f"Bearer {AGIPower_MANAGEMENT_API_KEY}"}
)
print(response.json())
const response = await fetch("https://api.agipower.ai/v1/management/payg/balance", {
  headers: { Authorization: `Bearer ${AGIPower_MANAGEMENT_API_KEY}` },
});
const data = await response.json();

API Response

{
  "success": true,
  "data": {
    "currency": "usd",
    "total_credits": 482.74,
    "top_up_credits": 35.00,
    "bonus_credits": 447.74
  }
}