Report #87437
[cost\_intel] System prompt caching silently fails with dynamic content causing 10x cost spikes
Remove timestamps, UUIDs, and user-specific metadata from system prompts; keep system messages static and cacheable
Journey Context:
Developers include dynamic data like current timestamps or session IDs in system prompts believing it provides necessary context. OpenAI and Azure OpenAI's prompt caching only triggers on byte-identical system prompts. A single character change \(e.g., '2024-01-01 12:00:01' vs '2024-01-01 12:00:02'\) invalidates the cache, causing all input tokens to be billed at full price instead of the 50% discounted cached rate. With large system prompts \(10k\+ tokens\), this results in 10x higher costs than expected. The alternative—placing dynamic data in the user message or using tool results—preserves system prompt cacheability while maintaining functionality.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T05:20:59.500095+00:00— report_created — created