When a tool call outlasts the cache: what a held-state prompt does to the bill
Architecture by Rajnish Choubey; tests by Shalendra Gaur (with an AI assistant as a tool: this article was written with AI assistance and every number is read from a saved file in the repository linked at the end). AXI i
Architecture by Rajnish Choubey; tests by Shalendra Gaur (with an AI assistant as a tool: this article was written with AI assistance and every number is read from a saved file in the repository linked at the end). AXI is a layer on the host side, for the company that runs the model; the model is unchanged and every claim here is about the state the host holds.
Prompt caching is one of the best tools in an LLM application's cost kit, and two recent engineering write-ups explain precisely where it needs care.
Anthropic's Lance Martin, in "Reducing cost and improving performance with Claude Platform" (8 September 2026), shows that a cache read costs a fraction of a full input token, and that the saving depends on the prefix staying stable. The five-minute cache lifetime counts from the start of the request, so a tool call or subagent that runs past five minutes can expire the parent's cache before its result returns; the next turn then pays 1.25 times the normal input price to rewrite it (2 times with the one-hour cache) instead of the cheap read price. The guide's advice is practical: a one-hour lifetime where tools or subagents run long, volatile values such as timestamps kept out of the prefix, rarely used tools deferred, the cache warmed at the start of a session. Its measured example, tau2-bench retail, came out about 73% cheaper with about 93% of the prompt cacheable and no change in pass rate.
NVIDIA's Ishan Dhanani and Matej Kosec, in "Full-Stack Optimizations for Agentic Inference with Dynamo", describe the same pattern from the serving side: an agent session's access pattern is write-once, read-many (in a 42-call Claude Code session, 891K cache-read tokens against 76K cache-write tokens, an 11.7 times ratio), a tool-call pause of 2 to 30 seconds can age an agent's prefix out of the cache, and per-block TTL retention is described as future API work.
Both pieces make one point: with a kept conversation, the cache is what keeps each step affordable, so what happens to the cache during a pause decides the cost of the next step.
What a held-state prompt changes
AXI, Rajnish Choubey's architecture for the company that runs the model, changes what is sent. The application holds the exact state and rebuilds a short prompt from it at every step; the model proposes one change; a deterministic gate admits or refuses it. The prompt is the size of the state, not of the history. It fits any LLM application that holds state, short jobs and long, from the first step.
Nothing in that prompt depends on a warm prefix. After a pause of any length, the next step sends the same few thousand tokens it would have sent without the pause.
What was measured
- One 1,500-step job on Gemini 3.8 Flash: 2,824 prompt tokens at every step, state exact on 1,500 of 1,500 steps, median time to first token 2.27 s. The kept chat of the same job, at prompts of 500,000 tokens or more, had 99.3% of its prompt served from cache, and still computed 5,419 tokens per exact step against 3,108 with AXI; its median time to first token was 9.13 s.
- Cost per verified step on a 400-turn job, at the rates in Google's own billing report: $0.0014 with AXI, $0.0148 with a kept chat and a warm cache (10.4 times as much), $0.0870 with a kept chat and a cold cache (61 times as much). On the day of the cache test Google's bill came within 1.3% of the logged total ($29.45 against $29.09); the bill gives the day's total, not each arm, and the warm figure is worked out from its tokens, not from a bill line.
So the cache gives the kept chat its best case, and a prompt that needs no cache still computes fewer tokens per exact step. Where a kept conversation is the right shape for a job, the cache guidance in the two write-ups is exactly what to follow; where the application can hold the state, there is nothing to expire.
A test you can run
Take one workload with long tool calls. Run it twice, once as a kept chat with the cache settings from the guide and once with the prompt rebuilt from held state, and read cost per verified step, cache hit rate and time to first token side by side. The numbers can be published whichever way they fall. Figures and how to run it on your workload:
- Billing check: https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/BILLING_CHECK.md
- Page for companies: https://github.com/gaurshalendra2412/axi-runtime/blob/main/docs/AXI_FOR_COMPANIES.md
Sources read for this article:
- Anthropic, "Reducing cost and improving performance with Claude Platform", Lance Martin (8 September 2026): https://claude.com/resources/articles/reducing-cost-and-improving-performance-with-claude-platform
- NVIDIA, "Full-Stack Optimizations for Agentic Inference with Dynamo", Ishan Dhanani and Matej Kosec (March 2026, updated 2 October 2026): https://docs.nvidia.com/dynamo/digest/agentic-inference
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.