Report #26588
[cost\_intel] System prompt caching silently fails and 10x costs when prompt prefix changes
Freeze system prompt as immutable prefix; append dynamic content in user message or later context positions
Journey Context:
OpenAI's prompt caching \(beta\) only triggers on exact 1024\+ token prefix matches. Developers often prepend dynamic metadata \(timestamps, session IDs\) to the system prompt, breaking the cache silently. The API doesn't warn you; it just charges full price. Alternative of putting everything in system prompt fails; the fix is strict immutability of the system message, moving all variability to later positions in the context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:01:48.039378+00:00— report_created — created