# Billing

## Billing Rules

- Billed by actual token usage; input and output priced separately
- Price unit: CNY / 1K tokens
- Both streaming and non-streaming requests support precise billing
- Failed requests (timeouts, upstream errors) are not charged

## Freeze-Settle Mechanism

Each request follows this billing flow:

1. **Pre-freeze** -- At request start, estimated cost is frozen from your balance based on input tokens
2. **Settlement** -- After completion, actual cost is calculated from real usage (input + output tokens)
3. **Refund difference** -- Any excess frozen amount is automatically returned to your balance

## Media Generation Billing

| Type | Billing Method |
| --- | --- |
| Image generation | Per image; price varies by model and size |
| Text-to-speech | Per character count |
| Speech-to-text | Per audio duration |
| Meeting minutes | `POST /v1/audio/minutes` (CN only). `xrtoken-minutes`: duration for ASR, tokens for summary. `doubao-minutes`: duration (transcription plus extras, or `all_activate` bundle). Rates are on the [Model Marketplace](/dashboard/models) |
| Video generation | Per video duration |

See the [Model Marketplace](/dashboard/models) for specific pricing.

## Web Search Billing

| Type | Billing Method |
| --- | --- |
| Web / global search | **Per successful call** (independent of result count); see model list for price |

Endpoint: `POST /v1/search` with body `Type=web|global`. Failures are not charged. See [Web Search](/docs/web-search).

## Balance API

```http
GET /v1/credits/balance
Authorization: Bearer tr-xxxxxxxx
```

Response:

```json
{
  "balance": 12.50,
  "frozen": 0.50,
  "available": 12.00,
  "currency": "USD"
}
```

| Field | Description |
| --- | --- |
| `balance` | Total wallet balance (includes amounts frozen by in-flight requests) |
| `frozen` | Funds currently held by pending requests |
| `available` | Spendable balance = `balance - frozen` |
| `currency` | `USD` (intl) or `CNY` (China edition) |

The intl edition (xrtoken.ai) reports `USD`; the China edition (xrtoken.net) reports `CNY`.
