Results / usage.cached-tokens
Cached input is included in total token usage
Cached input is reported separately; total token usage must include it according to the provider's accounting.
Bug class: Token usage misreported
The library reports token counts that differ from the provider's: cached or reasoning tokens are dropped or double-counted, or streamed usage is lost.
Cost and quota tracking is off, most often on cached prompts and reasoning models.
Requirements
| Level | Id | Check | Requirement | Providers |
|---|---|---|---|---|
| MUST | total-reconciles | usage_total_reconciles | Total token usage includes uncached input, cache reads, cache writes and output. | All |
| SHOULD | cached-input-reported | usage_matches_truth | The library reports the number of input tokens served from cache. | All |
Fixtures
| Provider | Tier | any-llm | litellm | pydantic-ai | tanstack-ai | vercel-ai |
|---|---|---|---|---|---|---|
| anthropic | documented | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |
| openai-chat | recorded | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |
| openai-responses | recorded | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |