Anthropic's prompt cache timeout creates hidden costs for developers taking breaks
An analysis of Claude API usage reveals that the default five-minute cache expiration window can dramatically increase costs when developers pause between requests, accounting for over 15% of observed spending.

Requesty, an AI gateway provider, released findings on Tuesday showing that Claude's prompt caching behavior can substantially raise API bills during routine work interruptions. The company examined 30 days of production traffic and found that an eight-minute coffee break during a Claude Opus 5.5 session with 210,000 tokens of context can convert a $0.04 cache read operation into a $1.05 cache write operation.
Between October 24 and November 22, Requesty tracked coding-agent traffic flowing through its gateway across Claude Code, OpenCode, Codex, Pi, and Kilo. The analysis revealed that expenses from rebuilding expired prompt caches following five- to 30-minute pauses represented 15.2% of total Claude API costs, substantially higher than the 0.8% figure for GPT models.
Anthropic explained to The New Stack that the five-minute default reflects typical request patterns during agent operation. The company stated: "The 5-minute cache costs less to write, so it's usually the better value when requests come close together, as they often do when an agent is working." Internal testing by Anthropic using Claude Opus 5.5 and Sonnet 5.5 demonstrated that five-minute caching delivered 15% to 19% cost savings compared to one-hour caching when requests arrived seconds apart.
The five-minute cache trap
Claude Sonnet 5.5 and GPT-6.1 Sol share identical pricing: $2 per million input tokens and $10 per million output tokens, with cache writes charged at 1.25 times the input rate and reads at 0.05 times the rate. Requesty's data showed that Sonnet 5.5 experienced cache misses 81.2% of the time following pauses between five and 30 minutes, compared with just 2.3% for GPT-6.1 Sol.
Anthropic's five-minute time-to-live window encompasses the model's response generation period, leaving developers roughly one minute to examine output and submit a follow-up request if a reasoning turn requires four minutes. According to Requesty's calculations, a 20-person engineering team relying on Opus 5.5 could incur an extra $1,380 monthly in cache rebuilding costs, assuming each developer takes four breaks lasting five to 30 minutes daily across a 20-day work month.
Anthropic noted that when pauses exceed 30 minutes—causing both providers' default caches to expire—the incremental costs represent 7.8% of Claude spending and 8.5% of GPT spending.
What code review costs
For teams requiring developers to examine diffs and authorize agent actions, cache expiration raises human oversight expenses when code reviews extend beyond the remaining time-to-live window. Anthropic told The New Stack: "Developers should take the time they need to review code."
Anthropic clarified that Claude Code applies a one-hour cache default to the primary conversation when developers operate within their subscription's complimentary usage tier. The five-minute default activates when developers authenticate via API keys, use cloud providers, or draw from paid usage credits after exhausting their subscription allowance. Requesty's billing records did not disclose what developers were performing between API calls.
When one-hour caching wins
Writing to a one-hour cache incurs twice Anthropic's standard input rate. Requesty determined that applying the longer time-to-live to all conversations would raise costs for 87% to 89% of individual sessions. While roughly 76% of Claude coding conversations in the dataset concluded within five minutes, sessions exceeding one hour accounted for approximately 80% of total spending.
Anthropic advised: "If pauses between 5 minutes and 1 hour are common, choose the 1-hour cache at the start of the conversation, since switching partway through means rebuilding the cache."
Testing on Anthropic's API and Google Cloud's Vertex AI showed that modifying the time-to-live of an active cache from five minutes to one hour requires rewriting the entire cached prefix. Delaying the switch until cache expiration in conversations reaching at least 10 turns reduced projected Claude spending by an estimated 5% to 7% in Requesty's simulations.
Starting with Claude Code v2.1.242, developers can configure promptCacheTtl to 1h for the main conversation while maintaining five-minute caching for subagents through subagentPromptCacheTtl.
Keep the cache alive
Requesty tested a keep-alive strategy where the harness resubmits the previous API request after 4.5 minutes of inactivity, setting max_tokens to zero and disabling streaming. By calibrating keep-alive requests based on conversation depth, Requesty projected net savings of 8% to 9%.
This technique demands retention of the prior request body and consistent use of the same provider, region, and credentials. The method cannot be used with explicitly activated thinking, structured outputs, forced tool selection, or Message Batches.
Despite aggregate savings, keep-alive requests raised costs for 43% to 52% of extended sessions in Requesty's simulations. Claude Code v2.1.251 and later versions report cache hit ratios and miss counts through /usage, while OpenTelemetry monitors cache read and creation tokens by user and session.