> ## 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.

# Interface

# Get PAYG Balance

<Tip title="💡 Troubleshooting">
  Encountering errors? See the [API Error Codes Reference](/en/guide/advanced/error-codes) for a complete list of error types and troubleshooting steps.
</Tip>

```
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**

```http theme={null}
Authorization: Bearer <AGIPower_MANAGEMENT_API_KEY>
```

* **Name**: `Authorization`
* **Format**: `Bearer &lt;API_KEY&gt;`
* **Description**: A Management API Key created in the [AGIPower Console](https://agipower.ai/platform/management)

<Warning title="⚠️ Management API Key required">
  This endpoint only accepts Management API Keys. Standard API Keys are not supported.
</Warning>

## 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).

<Info title="💡 Balance breakdown">
  `total_credits` = `top_up_credits` + `bonus_credits` (minor floating-point differences may apply).
</Info>

<Card title="GET /v1/management/payg/balance">
  ```cURL theme={null}
  curl https://api.agipower.ai/v1/management/payg/balance \
    -H "Authorization: Bearer $AGIPower_MANAGEMENT_API_KEY"
  ```

  ```python theme={null}
  import requests

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

  ```javascript theme={null}
  const response = await fetch("https://api.agipower.ai/v1/management/payg/balance", {
    headers: { Authorization: `Bearer ${AGIPower_MANAGEMENT_API_KEY}` },
  });
  const data = await response.json();
  ```
</Card>

<Card title="API Response">
  ```json theme={null}
  {
    "success": true,
    "data": {
      "currency": "usd",
      "total_credits": 482.74,
      "top_up_credits": 35.00,
      "bonus_credits": 447.74
    }
  }
  ```
</Card>
