Report #27177
[cost\_intel] Anthropic prompt cache miss silently inflating costs 10x when system prompt varies slightly
Pin system prompt to exact byte string; place cache\_control on first block only; verify cache hit via response header anthropic-cache-read-input-tokens
Journey Context:
Anthropic's prompt caching \(Aug 2024\) requires an exact prefix match. Dynamic content like timestamps or random IDs in the system prompt break the cache silently, causing full token pricing. The API returns the anthropic-cache-read-input-tokens header only on hits; its absence means you paid 10x for a cache miss. Common mistake is assuming whitespace or ordering doesn't matter.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:00:53.893940+00:00— report_created — created