Skip to main content
Every API response from ARouter includes detailed usage information. This lets you track costs and token consumption in real time without making additional API calls.

Usage in Responses

The usage object is returned in every non-streaming response (and in the final chunk of streaming responses):
{
  "id": "gen-abc123",
  "model": "openai/gpt-5.4",
  "usage": {
    "prompt_tokens": 120,
    "completion_tokens": 85,
    "total_tokens": 205,
    "prompt_tokens_details": {
      "cached_tokens": 60,
      "audio_tokens": 0
    },
    "completion_tokens_details": {
      "reasoning_tokens": 30,
      "audio_tokens": 0,
      "accepted_prediction_tokens": 0,
      "rejected_prediction_tokens": 0
    }
  }
}

Token Fields

FieldDescription
prompt_tokensTotal input tokens (includes cached tokens)
completion_tokensTotal output tokens (includes reasoning tokens)
total_tokensSum of prompt + completion tokens
prompt_tokens_details.cached_tokensTokens served from the provider’s prompt cache
completion_tokens_details.reasoning_tokensTokens used for internal reasoning (thinking models)
completion_tokens_details.accepted_prediction_tokensSpeculative decoding tokens accepted
completion_tokens_details.rejected_prediction_tokensSpeculative decoding tokens rejected

Cost Tracking

ARouter bills based on the actual token counts reported by the upstream provider. Pricing is passed through at cost — no inference markup. To calculate exact cost:
cost = (prompt_tokens × input_price_per_token) + (completion_tokens × output_price_per_token)
Cached tokens are typically billed at a reduced rate (often 50% of the standard input price). See Prompt Caching for details.

Streaming Usage

In streaming mode, the final SSE chunk includes the full usage object with empty choices:
{
  "id": "gen-abc123",
  "choices": [],
  "usage": {
    "prompt_tokens": 120,
    "completion_tokens": 85,
    "total_tokens": 205
  }
}
Enable streaming usage by passing stream_options: { include_usage: true } in your request.

Dashboard Reporting

All usage data is visible in the Activity page with filtering by:
  • Time period (1 hour → 1 year)
  • Grouping (Model, API Key, Creator)
Export as CSV or PDF for accounting and budget planning. See Activity Export.

API Access

Retrieve transaction history and balance programmatically:
# Get current balance
curl https://api.arouter.ai/v1/billing/balance \
  -H "Authorization: Bearer $AROUTER_API_KEY"

# List recent transactions
curl https://api.arouter.ai/v1/billing/transactions \
  -H "Authorization: Bearer $AROUTER_API_KEY"