Api reference
Query account balance
Query the account balance, gift balance, frozen amount and the quota usage of the current API Key.
GET /api/v1/balance
Returns the balance breakdown of the account that owns the API Key, plus the quota usage of the current Key. Read-only: no billing, no rate-limit consumption.
Auth: Authorization: Bearer sk-tp-...
| Field | Type | Description |
|---|---|---|
| object | string | Always balance |
| currency | string | Always CNY |
| total_credits | number | Total balance = principal + gift (yuan) |
| balance_credits | number | Principal balance = total − gift |
| gift_credits | number | Gift balance, already included in the total |
| frozen_credits | number | Amount frozen by in-flight tasks / requests; becomes a real charge once settled |
| available_credits | number | Available balance = total − frozen |
| used_credits | number | Cumulative spend of the account |
| key.name | string | Name of the current API Key |
| key.quota_limit | number / null | Quota of the current Key subtree; null means unlimited |
| key.used | number | Used quota of the current Key subtree |
Notes:
- The balance is account-level; the
keysection only reflects the current Key's own quota. - Charges deduct principal first, then gift.
- Async tasks (e.g. video) freeze the amount on submit; the freeze is charged on success and released on failure / timeout / cancellation.
- When
available_creditsis 0, new requests return402.