Prompt cache hits in agent sessions: 7 days of follow-up turns
367,701 follow-up turns from at least 1,150 accounts: 79.6% of prompt tokens came from cache when a turn stayed on its route, 68.0% when it moved.
In agent traffic each step resends the system prompt, the tools and the transcript, and a provider bills the part it still holds in its prompt cache at the cached rate. This is what seven days of follow-up turns on this gateway show about how often that happens and what breaks it.
What was counted
The window is the seven days from 2026-11-20 00:00 to 2026-11-27 00:00 UTC. In it the gateway logged 689,404 requests, 657,137 of them answered. A follow-up turn is a request that continues a conversation seen in the previous ten minutes: the same session id on the same account and model, or, without a session id, the same API key and model with a prompt at least as long as the last one. Only turns with a prompt of 2,000 tokens or more count. That gives 367,701 follow-up turns from at least 1,150 accounts.
A turn stayed when the route that answered it was the route that answered the previous turn, and moved otherwise. The cached share is cached prompt tokens divided by all prompt tokens, both as the serving host reported them. 0.25% of the requests in the window came from our own staff accounts; they are included.
Stayed against moved, by model family
339,855 turns stayed and 27,846 moved (7.6%). Every family below has at least 20 accounts behind each of its stayed, moved-by-choice and moved-after-failure turns; families with fewer are merged into the last row. A family row pools every build of that model.
| Família | Follow-up turns | Moved | Cached, stayed | Cached, moved | Extra per 1M moved tokens, list |
|---|---|---|---|---|---|
glm-5.3 | 91,889 | 5.3% | 91.4% | 72.5% | $0.168 |
glm-5.3-flash | 81,522 | 15.8% | 78.4% | 68.9% | $0.011 |
deepseek-v4.1-flash-1017 | 61,875 | 4.9% | 74.6% | 46.0% | $0.084 |
deepseek-v4.1-flash | 25,642 | 8.4% | 40.3% | 57.2% | $0.000 |
deepseek-v4-flash-0731 | 18,636 | 3.1% | 87.8% | 86.6% | $0.002 |
kimi-k3.1-pro | 8,820 | 12.1% | 90.0% | 69.3% | $0.371 |
deepseek-v4-pro | 7,186 | 8.2% | 94.7% | 82.4% | $0.158 |
gemini-4-argon | 3,658 | 16.9% | 55.8% | 37.2% | $0.353 |
claude-haiku-5-5 | 1,057 | 8.7% | 12.0% | 21.3% | $0.000 |
| other families, merged | 67,416 | 2.9% | 75.6% | 67.0% | n/a |
Cached share = cached prompt tokens / prompt tokens. Last column: the list-price cost of the cache lost on moved turns, per million prompt tokens on those turns.
On glm-5.3 builds the cached share was 91.4% on turns that stayed and 72.5% on turns that moved. On kimi-k3.1-pro it was 90.0% and 69.3%.
Why a turn moves
A turn moves for one of two reasons. Either the first route tried failed and another one answered (a failover, 15,281 turns), or the routing order put a different route first and it answered on the first attempt (12,565 turns). Failovers lost more: 64.3% of their prompt tokens were cached, against 72.7% for moves by choice and 79.6% for turns that stayed.
A provider's prompt cache is held where the previous turn ran. A turn sent to another route can only hit that route's cache, which holds the prefix only if earlier traffic sent it there.
Where moving raised the cached share
Two families went the other way. deepseek-v4.1-flash was 40.3% cached on turns that stayed and 57.2% on turns that moved, claude-haiku-5-5 12.0% and 21.3%. Both have a low cached share on turns that stay. Our guess, not checked route by route, is that the route most of their turns stay on reports few cache reads and some moves land on a route that reports more. Keeping a conversation on its route pays only where that route caches.
What a lost cache costs at list prices
A prompt token that misses the cache is billed at the input rate instead of the cached rate. This is an estimate, not a measured loss on the same turns: it assumes a moved turn would have been cached at its family's stayed share. Priced at the developers' list rates as published, it comes to (stayed share minus moved share) times (input rate minus cached rate) per million prompt tokens on a moved turn, floored at zero where the moved share was higher. For kimi-k3.1-pro that is about 20.7 points of $2.00 minus $0.20, or $0.371 per million from the unrounded shares; for glm-5.3, 18.9 points of $1.092 minus $0.2028, or $0.168.
Summed over the nine families with a list price, the week's moved turns carried 2.04 billion prompt tokens, and the estimate comes to $176.95 at list prices for the week. The figure is small because only 7.6% of turns, carrying 6.9% of prompt tokens, moved. For a team whose agents move on every failure, or that spreads one conversation across providers on purpose, the same arithmetic applies to every turn.
What to check in your own bills
- Log the cached prompt count each response returns:
usage.prompt_tokens_details.cached_tokensin OpenAI-format responses,usage.cache_read_input_tokensin Anthropic-format ones. - Group requests into conversations and look only at turn two onward. The first turn has no earlier turn of its own to reuse. On Anthropic-format bills, cache writes (
cache_creation_input_tokens) are priced apart from misses; count them separately. - If your own code fails over between providers, log which one answered. Then compare the cached share on turns that stayed with the provider of the last turn against turns that did not. The script below does that from a CSV export. It groups by provider, which is coarser than the route-level split above. In OpenAI-format usage
prompt_tokensalready includes the cached count; in Anthropic-format usage addinput_tokens,cache_read_input_tokensandcache_creation_input_tokens. - Read the first few hundred tokens of your system prompt. A timestamp or request id ahead of the stable text changes the prefix on every call.
- Multiply the tokens that missed by the input rate minus the cached rate. That is what the misses cost.
# One line per request from your own logs: conversation id, provider that answered,
# prompt tokens, cached prompt tokens. Prints the cached share by "same provider as the last turn" or not.
import csv, collections
last, sums = {}, collections.defaultdict(lambda: [0, 0])
for r in csv.DictReader(open("requests.csv")): # rows in time order
conv, prov = r["conversation"], r["provider"]
p, c = int(r["prompt_tokens"]), int(r["cached_tokens"])
if conv in last:
k = "stayed" if last[conv] == prov else "moved"
sums[k][0] += p; sums[k][1] += c
last[conv] = prov
for k, (p, c) in sums.items():
print(k, f"{100 * c / p:.1f}% of prompt tokens cached")On this gateway the response body's usage carries the cached count and the charge, and the usage export has both per request. Cached rates by model are on the prompt caching price table.
What we changed
Since 02:01 UTC on 2026-11-27 the router sends a follow-up turn back to the route that answered the previous one when that route is healthy and, warm, costs no more than the other routes cold. That covers moves by choice only; it does nothing for a turn whose route has just failed. Comparing the hour before the change with the hour after, the moved share on all follow-ups went from 4.1% to 4.3% and the cached share from 89.1% to 90.9%, which one hour cannot separate from noise. The window above ends before the change, so it is the baseline. We will run the same query on the seven days to 2026-12-04 and publish the comparison.
Method and data
The query ran on production usage rows in 168 one-hour windows, each with a ten-minute look-back so a turn near the start of an hour still finds its previous turn. It returned only sums per model and class: turns, turns with any cached token, prompt tokens, cached tokens, and the three-character account-id fragments used for the account bound below. No prompt text, account id or key appears in the output or the CSV. Account counts are a lower bound, counted on a three-character fragment of the account id so that two accounts can collide but one account is never counted twice.
Limits: token counts are what each host reported, and a host that does not report cache reads counts as zero cached. Prompts include every system message on the request. The key-based match can join two users of one shared key into one conversation. List prices are the developers' published rates as our catalog records them on 2026-11-27.
Download: prompt-cache-follow-up-turns-2026-11-20-to-27.csv (one row per family, 26 columns, with the token denominators for every share).