Reasoning and prompt caching
Configure model-specific reasoning and interpret cache usage and charges.
Reasoning parameters
Reasoning can help multi-step analysis, but configuration depends on model and protocol. Verify a basic text request before adding explicitly supported fields.
Protocol | Common field location |
|---|---|
Chat Completions | |
Responses | |
Messages | |
These fields are not a compatibility promise for every model. Do not combine reasoning parameters from different protocols or treat another service's special model suffixes as iRouter IDs.
Output and latency
Reasoning can increase latency and output usage. Handle limits and incomplete responses and use protocol-specific streaming. Do not assume the model exposes its complete internal reasoning text.
Visible answer length is not necessarily the total billable token count. Check model rules and server-reported usage.
Prompt caching
Stable system instructions, tool definitions, and document prefixes can enable prefix reuse on caching-capable models. Hits depend on the model, line, content, and request format. This documentation does not promise a fixed hit rate, retention period, or discount.
Chat Completions may report usage.prompt_tokens_details.cached_tokens. Messages may report cache reads and writes separately. Do not infer hit counts when fields are absent.
Reconcile charges
Check whether cached tokens are already included in total input usage for the protocol. Do not add cache charges on top of the full input total when that would count them twice. Estimate input, output, and cache categories using the model's prices, then compare with usage records.