Usage Accounting
SIRAYA Model Router provides transparent tracking of model usage, token counts, and associated costs. Responses carry token counts; the billed cost of each request is available in the console Request Logs and programmatically through the External Console API.
Token Counting
By default, SIRAYA Model Router returns token counts in the usage field of the API response.
- Native Tokenization: Costs and billing are always calculated using the model provider's native tokenizer.
Response Format
The usage object of a Chat Completions response includes the fields below. prompt_tokens, completion_tokens, and total_tokens are always present, and so are both detail objects with their standard fields set to 0 when they do not apply (cached_tokens, audio_tokens, reasoning_tokens, accepted_prediction_tokens, rejected_prediction_tokens). All other detail fields, server_tool_use and backend-specific keys appear only when non-zero or when the backend reports them. Responses do not include a cost field; see Billing Transparency to estimate cost, the Request Logs for the amount charged, or the External Console API to read billed cost programmatically.
/v1/responses and /v1/messages report usage in their native shapes (input_tokens and output_tokens, with cache counts in input_tokens_details for Responses and cache_read_input_tokens / cache_creation_input_tokens for Messages). The tables below describe Chat Completions.
| Field | Description |
|---|---|
prompt_tokens |
Total tokens sent in the request, including cached and cache-written tokens. |
completion_tokens |
Total tokens generated by the model, including reasoning tokens. |
total_tokens |
The sum of prompt and completion tokens. |
prompt_tokens_details |
Object. Breakdown of prompt tokens by source (cache, modality). See below. |
completion_tokens_details |
Object. Breakdown of completion tokens by category (reasoning, audio, predictions). See below. |
server_tool_use |
Object. Counters for built-in server-side tool calls (e.g. native web search). Returned for Gemini models and for GPT models when the search count is reported (it carries web_search_requests). Claude on Chat Completions returns search annotations without it. Don't rely on it for billing reconciliation. |
Backend-specific fields not defined above (e.g. a seconds field for video models) are passed through as additional keys on usage for diagnostics.
prompt_tokens_details
| Field | Description |
|---|---|
cached_tokens |
Prompt tokens served from prompt cache (cache hit). |
cache_creation_tokens |
Prompt tokens written into cache on this request (prompt caching). |
cache_creation_token_details |
Object splitting cache writes by TTL. Contains ephemeral_5m_input_tokens and ephemeral_1h_input_tokens. |
text_tokens |
Text input tokens. |
audio_tokens |
Audio input tokens (multimodal models). |
image_tokens |
Image input tokens (multimodal models). |
video_tokens |
Video input tokens (multimodal models). |
cached_text_tokens, cached_image_tokens, cached_audio_tokens, cached_video_tokens |
Per-modality split of cached_tokens, when the model reports it. |
completion_tokens_details
| Field | Description |
|---|---|
reasoning_tokens |
Hidden reasoning tokens billed alongside the completion (e.g. GPT-5.x, Gemini thinking). |
audio_tokens |
Audio output tokens (audio-capable models). |
accepted_prediction_tokens |
Speculative decoding: tokens that were accepted from the predicted draft. |
rejected_prediction_tokens |
Speculative decoding: tokens that were rejected and re-generated. |
text_tokens |
Text output tokens. |
image_tokens |
Image output tokens (e.g. GPT Image 2, Gemini image). |
video_tokens |
Video output tokens. |
Usage in Streaming
For streaming requests, usage statistics are automatically included in the final SSE chunk; the router turns on stream_options.include_usage for every streaming request. Sending it yourself is optional and harmless:
{
"model": "claude-sonnet-4.6",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true,
"stream_options": {
"include_usage": true
}
}
The final chunk in the stream, the one with an empty choices array, contains the usage statistics in the same shape as a non-streaming response:
{
"choices": [],
"usage": {
"prompt_tokens": 8,
"completion_tokens": 52,
"total_tokens": 60,
"prompt_tokens_details": {
"cached_tokens": 0,
"audio_tokens": 0
},
"completion_tokens_details": {
"reasoning_tokens": 0,
"audio_tokens": 0,
"accepted_prediction_tokens": 0,
"rejected_prediction_tokens": 0
}
}
}
Billing Transparency
You can view your usage history in the Request Logs and overall spend metrics in the Dashboard. All charges are based on the specific model's price per 1M tokens as listed in our Models Page. To read billed cost per request from your own systems, use the External Console API.