XRToken API Docs

Billing

Token-based billing model and settlement mechanism

API Configuration
After saving, the Try It panel below sends real requests with this key.
Base: api.xrtoken.ai

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

TypeBilling Method
Image generationPer image; price varies by model and size
Text-to-speechPer character count
Speech-to-textPer audio duration
Meeting minutesPOST /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
Video generationPer video duration

See the Model Marketplace for specific pricing.

Web Search Billing

TypeBilling Method
Web / global searchPer 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.

Balance API

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

Response:

{
  "balance": 12.50,
  "frozen": 0.50,
  "available": 12.00,
  "currency": "USD"
}
FieldDescription
balanceTotal wallet balance (includes amounts frozen by in-flight requests)
frozenFunds currently held by pending requests
availableSpendable balance = balance - frozen
currencyUSD (intl) or CNY (China edition)

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

On this page