Vibeleaderboard
← All Intel
Intel / post

Prompt cache TTL is a hidden cost in long agent sessions

Source
x.com
Date
AlphaSignalAI@AlphaSignalAI

Your 5-minute cache is already dead when you sit down. API models don't keep the thread. Every turn resends the whole history. A one-token tool result still pays that whole history. On Opus 5, 1 million uncached tokens are $5. A hit is $0.50. Cache-hit discounts are provider-specific. > Anthropic 0.1x on a hit > OpenRouter blend near 1/5 > Grok 4.6 cache read 0.25x > DeepSeek Flash off-peak 0.03x Earlier, we ran 4.5 through 12 turns at 30,000 tokens. Turns 2 and 10 were full-price re-reads. Compact before you walk away so the miss stays small. Buy the 1-hour write at 2x, and a return can hit. Claude Code and Codex often compact around 200,000 to 300,000 tokens. Filling 1 million on purpose buys the expensive part. So, What do you pin so the cheap copy stays cheap? Where does the project live so compact doesn't wipe it? Why is dollars per million the wrong scoreboard? Full Breakdown ↓↓

Context

only saves money if the next request arrives before the cache expires, and AlphaSignal's post argues that long agent sessions routinely miss that window. models keep no memory between turns, so every turn resends the whole conversation. A cache lets the provider reuse the already processed part at a discount: Anthropic's documentation prices cache reads at 0.1 times the normal input rate for most models, with a default five-minute lifetime that resets each time the cache is used. Step away longer than that and the next turn, even one carrying a one-token tool result, pays full price to re-read the entire history. On Opus 5, the post puts that at $5 per million tokens against $0.50 on a hit.

AlphaSignal says that in its own earlier test, a 12-turn at 30,000 tokens, turns 2 and 10 were full-price re-reads. Its advice follows from the mechanism: compact the conversation before walking away so a miss re-reads less, or pay for Anthropic's one-hour cache, which the documentation prices at twice the base input rate to write, so a later return can still hit. Discounts differ by provider; the post cites 0.25 times for cache reads on Grok 4.6 and 0.03 times off-peak on DeepSeek Flash, figures this explanation did not check against those providers. An earlier AlphaSignal article on switching models mid-session measured the same kind of penalty from another direction: one switch in a 60,000-token session cost about 11 times a warm turn.

Terms in this piece · Glossary
  • prompt caching — Reusing the model's processed form of a repeated prompt prefix so subsequent calls skip re-reading it, cutting cost and latency substantially.
  • API — Application programming interface: the agreed set of operations, inputs and outputs through which one piece of software uses another.
  • Session — One conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.
  • Compaction — Replacing older content in the model's context with a summary of it, usually keeping recent messages, so that a session can go on.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from AlphaSignalAI
Recommended reads