Results / usage.reasoning-tokens
Token usage accounts for thinking and answer tokens
Token usage includes reasoning and answer tokens, with provider-specific output 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 usage agrees with the provider, including thinking tokens. | All |
| SHOULD | reasoning-reported | usage_matches_truth | The separately reported thinking token count is exposed. | All |
Fixtures
| Provider | Tier | any-llm | litellm | pydantic-ai | tanstack-ai | vercel-ai |
|---|---|---|---|---|---|---|
| anthropic | documented | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |
| gemini | recorded | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |
| openai-chat | recorded | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |
| openai-responses | recorded | ✓ PASS | ✓ PASS | ✓ PASS | – UNSUPPORTED | ✓ PASS |