Engineering brief
Prompt Caching: The Hidden Cost Lever in AI Agents
At a glance
- Relevance
- Practical value
- Warnings
- None
A 200k-token agent session costs $41 without prompt caching—and $4 with it. The difference is how you design system prompts.
Prompt caching is the difference between viable agents and bankrupt operations.
Summary
Prompt caching is misunderstood. The common mental model—caching LLM outputs like database results—is wrong. What actually happens is input caching: the model's attention mechanism reuses previously computed states. When an agent resends 50k tokens of conversation history with each turn, those first 50k tokens are processed at full price only once. Subsequent reads cost roughly
10% of the original price. Without caching, a 200k-token session on Claude Opus 5 or GPT-5.6 Sol can cost $41. With caching, that drops dramatically—to near zero on providers like DeepSeek. The practical implication for teams running agents is obvious: caching is the difference between viable and bankrupt. But the operational details matter. Cache expiry
varies widely—OpenAI keeps it for an hour, Anthropic for five minutes on the API but an hour with Claude Code, and Hugging Face routing depends on the provider. Every cache miss resets you to full price. This creates an invisible budget risk: a lunch break can cost your team hundreds of dollars if the cache
expires mid-session. Most teams skip the subtle failure mode: dynamic system prompts. Adding a timestamp, current working directory, or dynamically updated tool list to the system prompt invalidates the entire cache on every change. That one small line of metadata can erase 90% of your cost savings. The fix is trivial but rarely taught—keep system
Watch the video
This video is blocked due to your privacy settings. To watch this video, please accept YouTube marketing cookies.
Related breakdowns
Opus 5.5 fixes quality, but the effort trap costs more than tokens.
Opus 5.5 is a genuine coding upgrade at better pricing, but max effort is a token furnace and design work still needs Fable. The real win? Zero data…
Real-Time AI Video Streaming Works, But Costs Crush the Hype
Real-time AI video streaming is technically feasible—but at $14+/hour for low-res, the cost barrier is the real story. A hands-on demo reveals the tradeoff…
Local AI Just Got Real: 27B Model Rivals Big APIs for Half
A 27B open model now rivals frontier models on benchmarks, but its token waste and slow inference reveal the real tradeoff: ownership vs. speed in local AI.
Get TL;DW
Too Long; Didn't Watch.
A concise breakdowns of the AI and devtools videos that actually matter for engineering leaders.
Free. Weekly. No hype.
Video and thumbnails remain the property of their respective creators. tldw.news provides editorial analysis, commentary, and discovery links to original content.