Submit a toolSubmit

Claude API cache_read_input_tokens stays 0. Fix prompt caching misses

cache_creation and cache_read stay 0, or writes never become reads. Stabilize the prefix, meet the minimum, stay in the TTL, and use cache diagnostics. Short answer: 5 steps. 1) Confirm caching is actually enabled and check usage fields; 2) Meet the minimum cacheable prefix for your model; 3) Keep tools → system → messages byte-identical through the breakpoint; 4) Respect the TTL—and that response time counts against it; 5) Use cache diagnostics when hits still fail.

Last updated: · This page is the decision checklist; the tools list for “Fix Claude API prompt caching misses” is a separate URL.

The problem: cache_creation and cache_read stay 0, or writes never become reads. Stabilize the prefix, meet the minimum, stay in the TTL, and use cache diagnostics.

How do I stabilize the prefix and use cache diagnostics when cache reads stay at 0?

  1. Confirm caching is actually enabled and check usage fields

    Prompt caching is opt-in on the Messages API. Use top-level automatic `cache_control` or put `cache_control` on specific blocks. After each call, read `usage.cache_creation_input_tokens` and `usage.cache_read_input_tokens`. If both are 0, nothing was cached—there is no separate error for a silent miss. Docs: https://platform.claude.com/docs/en/build-with-claude/prompt-caching

  2. Meet the minimum cacheable prefix for your model

    Prefixes shorter than the model minimum are processed without caching and return no error. On the Claude API (and listed cloud platforms), minima include 512 tokens for current Fable/Mythos 5.x, Opus 5.5, Sonnet 5.5, and Haiku 5.5; 1,024 for several Sonnet 4.x/5 and Opus 4.8 lines; and 2,048–4,096 for older Opus 4.x / Haiku 4.5 rows—check the Cache limitations table for your exact model. Expand stable system or tool text until you clear the threshold.

  3. Keep tools → system → messages byte-identical through the breakpoint

    Caching is a prefix match. A timestamp in the system prompt, reordered tool JSON keys, a changed `tool_choice`, a different thinking/`output_config.effort` setting, or an image that appears on only some turns invalidates everything after the change. Put `cache_control` on a stable block; do not put the breakpoint on the per-request user turn you expect to change every call.

  4. Respect the TTL—and that response time counts against it

    Default ephemeral TTL is 5 minutes from the start of the request that wrote or read the entry. A long streaming response consumes that window, so a follow-up may need to start sooner than “five minutes after the reply finished.” For longer reuse, set a 1-hour TTL (higher write price). Stay in the same organization/workspace; traffic split across workspaces does not share cache entries.

  5. Use cache diagnostics when hits still fail

    On the next request, pass `diagnostics.previous_message_id` with the prior response `id`. The API compares fingerprints and reports whether the model, system prompt, tools, or message history diverged—without guessing from a zero `cache_read_input_tokens`. For parallel identical calls, wait until the first response starts before sending the others; a cache entry is not readable until then. Diagnostics: https://platform.claude.com/docs/en/build-with-claude/cache-diagnostics

Which tools are best to fix Claude API prompt caching misses?

Prompt caching docs

Automatic vs explicit cache_control, TTL, minima, and troubleshooting.

Cache diagnostics

Compare consecutive requests with diagnostics.previous_message_id to find prefix drift.

Claude API pricing

Cache write vs cache read token prices for 5-minute and 1-hour TTL.

Anthropic Console

Where to inspect usage after you fix silent cache misses.

All tools for “Fix Claude API prompt caching misses” →

Related fixes

See also AI tools launched today on the daily board.