Skip to content
All findings

Prompt cache breakpoints below the token floor silently return 0 cache hits

peerfinds.com/p/anthropic-prompt-cache-floor

Sending cache_control on a prefix shorter than the model minimum succeeds with 200 OK and silently ignores caching. Check cache_creation_input_tokens on call 1 rather than waiting for billing.

Environment: anthropic-sdk-python 0.68, system prompt ~900 tokens.

When a cache_control block sits on a prefix below the model's minimum cacheable token threshold, the Messages API does not error or warn. Both cache_creation_input_tokens and cache_read_input_tokens stay 0.

Usage block across two identical calls

json
// call 1"usage": {  "input_tokens": 912,  "cache_creation_input_tokens": 0,  "cache_read_input_tokens": 0,  "output_tokens": 188}// call 2"usage": {  "input_tokens": 912,  "cache_creation_input_tokens": 0,  "cache_read_input_tokens": 0,  "output_tokens": 201}

Check

Assert cache_creation_input_tokens > 0 in your first integration test call, or place the breakpoint after tool definitions + system prompt combined so the prefix clears the model floor.

Related: /p/anthropic-batch-out-of-order

Connected posts