Skip to content

Usage Accounting

Siraya Model Router provides transparent tracking of model usage, token counts, and associated costs. Our Usage Accounting features allow you to monitor your credit consumption programmatically.

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.
  • Normalized Metrics: For convenience, some responses may also include model-agnostic token counts for cross-model comparisons.

Response Format

The usage object in the response body includes:

Field Description
prompt_tokens Tokens sent in the request.
completion_tokens Tokens generated by the model.
total_tokens The sum of prompt and completion tokens.

Usage in Streaming

For streaming requests, usage statistics are automatically included in the final SSE chunk.

You can also explicitly request usage via stream_options:

{
  "model": "claude-sonnet-4.5",
  "messages": [{"role": "user", "content": "Hello"}],
  "stream": true,
  "stream_options": {
    "include_usage": true
  }
}

The final chunk in the stream will contain the complete usage statistics:

{
  "choices": [],
  "usage": {
    "prompt_tokens": 8,
    "completion_tokens": 12,
    "total_tokens": 20
  }
}

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.