Claude's 5-minute prompt cache costs coding agents 15% on short breaks, Requesty finds; Claude Code subscribers already get 1 hour
Requesty, an LLM gateway, has put a number on what it costs to step away from a Claude-powered coding agent for ten minutes. In a post titled "Claude 5-minute prompt cache vs GPT 30-minute cache: the cost of pauses" (December 1), Daniel Van den Berghe reports that across 30 days of coding-agent traffic on its gateway, from October 24 to November 22, rebuilding prompt caches after breaks of 5 to 30 minutes took 15.2% of the Claude bill and 0.8% of the GPT bill. Counting every break over five minutes, the figures are 23.1% and 9.3%.
The traffic came from Claude Code, OpenCode, Codex, Pi and Kilo, and Requesty says it used token and billing counters only, no prompt text. I can't check the dataset, but I could check the mechanism it describes against Anthropic's and OpenAI's documentation, and the docs back it up. They also show that one large group of Claude users mostly isn't in this picture.
Same prices, different timers
A coding agent re-sends the whole conversation on every turn: system prompt, tool definitions, every diff and test log so far. Prompt caching means the unchanged prefix is billed at a fraction of the input price, and only the new part is written to the cache at a premium. Anthropic's prompt caching page lists, for Claude Opus 5.5, $4 per million input tokens, $5 for a five-minute cache write, $8 for a one-hour write, and $0.20 for a cache hit (Opus 5.5 and Sonnet 5.5 read at 0.05x; most other models at 0.1x). OpenAI's prompt caching guide uses the same 1.25x write rate for GPT-5.6 and later, and reads at 0.05x on GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Sol and GPT-6.1 Terra.
The difference is how long an idle cache survives. On the Claude API the default is five minutes, and the clock starts at the beginning of the last request, so, in Anthropic's words, "if a response takes 4 minutes to stream, a follow-up request that reuses the same cached prefix must start within about 1 minute of that response completing." OpenAI's default for GPT-5.6 and later is a minimum of 30 minutes ("30m"), with a "12h" option in the Responses API at 2.5x.
While the agent works on its own, requests arrive every few seconds and each one refreshes the timer. The cost appears when it stops and waits for a person. Requesty's example: an eight-minute break on a 210,000-token Opus 5.5 session turns a $0.04 cache read into a $1.05 rewrite. That checks out at list price: 0.21 million tokens at $0.20 is $0.042, and at $5 it is $1.05. On GPT-6.1 Sol the same break leaves 22 minutes on the clock.
Requesty's hit-rate curves show the cliffs where the docs say they should be: on the Anthropic API, full cache hits fall from 98.4% at 4:45–5:00 of idle time to 6.5% at 5:15–5:30; GPT-6.1 Sol on Azure holds 95.8% until 27–29 minutes and drops to 1.9% by 31–33. The pause rates themselves are the same on both model families (3.3 pauses over five minutes per 1–4 hour session on each), which is Requesty's answer to the obvious objection that Claude users simply take more breaks.
Claude Code subscribers mostly get the hour
The Claude Code documentation adds a piece the Requesty post doesn't spell out. Its page on how Claude Code uses prompt caching says Claude Code picks the TTL per request, and "requests the one-hour TTL only on a Claude subscription within your plan's included usage." There, the main conversation gets one hour. With an API key, a cloud provider or usage credits, it gets five minutes. Subagents, compaction, forks and session titles get five minutes almost everywhere.
So the 5-minute cliff in Requesty's data is mostly a pay-as-you-go problem: API keys, Bedrock, Vertex, and gateways like Requesty itself. Requesty reports that Claude Code used the one-hour TTL on only 2% to 10% of large Claude writes on most routes, which fits API-key traffic. Two cases bring subscribers back into it:
- Going over the plan. "Once you go over your plan's usage limit and Claude Code draws on usage credits... Claude Code drops the main conversation to the five-minute TTL." The moment you start paying per token is the moment the cache gets shorter.
- Subagents. Their requests stay on five minutes unless you set
subagentPromptCacheTtl.
For API-key users the switch exists: promptCacheTtl set to 1h, or CLAUDE_CODE_PROMPT_CACHE_TTL=1h (Claude Code v2.1.242 or later). The docs also note that through an ANTHROPIC_BASE_URL gateway, part of the one-hour request travels in the anthropic-beta header, so the gateway has to forward it. To see what you actually got, run claude -p "hello" --output-format json and look for ephemeral_1h_input_tokens versus ephemeral_5m_input_tokens in usage.cache_creation.
Is the hour worth 2x?
Requesty's replay of its own traffic gives a result that looks contradictory at first: switching every session to the one-hour cache from turn one lowers the total Claude bill by 1% to 10% depending on the model, yet 87% to 89% of sessions pay more.
The arithmetic explains it. Each token is written to the cache once, so moving a session from five-minute to one-hour writes costs an extra $3 per million tokens of final prefix on Opus 5.5 ($8 minus $5). A single expired cache costs $4.80 per million tokens of the prefix at that moment ($5 write minus the $0.20 read it replaced). For a session that ends at 200,000 tokens, the hour costs $0.60 extra; one miss at 125,000 tokens costs the same $0.60. Roughly: one break of 5 to 60 minutes after the prefix has reached about 60% of its final size pays for the hour. Most sessions never get there, since Requesty says 76% of Claude coding conversations finish inside five minutes, but sessions longer than an hour carry about 80% of spend, and those have several breaks. So most sessions lose a little and the expensive ones save a lot.
Requesty also reports, from live tests on the Anthropic API and Vertex, that switching a warm five-minute conversation to one-hour markers mid-session read nothing and rewrote the whole prompt at 2x, whereas Bedrock read the five-minute prefix. I couldn't reproduce that without API access; if it holds, the safe moments to switch are turn one or the first turn after a miss, when the cache is gone anyway.
The keep-alive ping
The option Requesty found cheapest is a ping: after about 4.5 minutes idle, re-send the exact last request with max_tokens: 0. This uses a documented feature. Anthropic describes max_tokens: 0 for cache pre-warming: the API "reads your prompt into the model and writes the cache at any cache_control breakpoint, then returns immediately without generating any output," and zero output tokens are billed. A ping on a warm prefix is billed as a cache read, which resets the timer.
Whether a ping pays depends on whether the person comes back. On Opus 5.5 at 200,000 tokens a ping costs $0.04 and a miss $0.96, so the ping is worth it if the chance of a return before the next ping is above 0.04 / 0.96, about 4.2%, the same threshold Requesty gives. Its production data puts the return probability at 2.7% on turns 1 to 5 and above 15% after turn 10, which is why it recommends no pings on short threads and a few on deep ones. Requesty reports about 8% to 9% net off the Claude coding bill this way. The documented limits matter: max_tokens: 0 is rejected with thinking.type: "enabled", forced tool_choice, structured outputs and Message Batches, so a harness that runs with extended thinking can't use the trick as is.
Equal price sheets, unequal bills
For anyone paying per token, the "same price" of Claude Sonnet 5.5 and GPT-6.1 Sol ($2 in, $10 out, by Requesty's table) isn't the same bill in an interactive coding workflow. Requesty puts the expected cost of a 5–30 minute break at $0.28 on Sonnet 5.5 against $0.008 on GPT-6.1 Sol, because the miss rates are 81.2% and 2.3%. The fixes are a setting away in Claude Code (promptCacheTtl) or a few lines in a custom harness.
Two caveats. The numbers are one gateway's customers, measured by a company that sells routing and has a stake in cost stories, and the replays are simulations on its own logs. And a Claude subscriber working inside the plan, the case most Claude Code users are in, already gets the one-hour cache on the main conversation; the cliff waits for them at the point where they start paying extra.
- Requesty (Daniel Van den Berghe): Claude 5-minute prompt cache vs GPT 30-minute cache: the cost of pauses (Dec 1, 2026)
- Claude Code docs: How Claude Code uses prompt caching
- Claude Platform docs: Prompt caching (pricing, TTL, pre-warming with max_tokens: 0)
- OpenAI API docs: Prompt caching (30m default, 12h option for GPT-5.6 and later)
Comments
No comments yet. Be the first.