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

LevelIdCheckRequirementProviders
MUSTtotal-reconcilesusage_total_reconcilesTotal token usage includes uncached input, cache reads, cache writes and output.All
SHOULDcached-input-reportedusage_matches_truthThe library reports the number of input tokens served from cache.All

Fixtures

ProviderTierany-llmlitellmpydantic-aitanstack-aivercel-ai
anthropicdocumented✓ PASS✓ PASS✓ PASS– UNSUPPORTED✓ PASS
openai-chatrecorded✓ PASS✓ PASS✓ PASS– UNSUPPORTED✓ PASS
openai-responsesrecorded✓ PASS✓ PASS✓ PASS– UNSUPPORTED✓ PASS