Report #85433
[cost\_intel] System prompt caching silently misses causing 10x cost inflation
Verify exact prefix match including whitespace and timestamps; check API response headers for cache 'write' vs 'read' status before assuming cache hits
Journey Context:
Anthropic's prompt caching requires identical byte-prefix matches for the entire system prompt and user content up to the cache breakpoint. Dynamic content like timestamps or UUIDs in the system prompt break caching silently—you pay full input tokens without warning. The API returns usage.cache\_creation\_input\_tokens vs usage.cache\_read\_input\_tokens; if the former is non-zero on subsequent calls, your cache key changed. Common failure: adding 'Current date: \{timestamp\}' to system prompt. Fix: Move dynamic data after the cache breakpoint or use cached system prompts with static IDs only.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:59:14.011564+00:00— report_created — created