Anthropic API · api · fg-0475

Prompt caching silently does nothing: cache_creation_input_tokens and cache_read_input_tokens stay 0

If you see usage.cache_creation_input_tokens: 0 and usage.cache_read_input_tokens: 0 on every call, the cause and the fix for Anthropic API are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
usage.cache_creation_input_tokens: 0 and usage.cache_read_input_tokens: 0 on every callNo error although cache_control is set on the blockParallel first requests all miss the cache
Cause
A prefix shorter than the model's minimum cacheable length is processed uncached and no error is returned. The minimum differs by model: 512 tokens on the 5.x models, 1,024 on Sonnet 4.6 and Opus 4.8, 2,048 on Opus 4.7, and 4,096 on Opus 4.6, Opus 4.5, and Haiku 4.5.
Fix
Check both usage fields on the second identical call. If both are 0, grow the cached prefix past the model's minimum or move the breakpoint later. A cache entry exists only after the first response begins, so send one request and wait before fanning out.
Apply
const u = res.usage; if (!u.cache_creation_input_tokens && !u.cache_read_input_tokens) console.warn('prompt not cached: prefix below the model minimum or breakpoint misplaced');
Affected
Claude API, Claude Platform on AWS, Google Cloud, Microsoft Foundry, minimums as of 2026-10; Bedrock documents its own minimums
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun