Blog · 2026-07-19 · Vynaris Team
Agent economics: where the tokens actually go in a 12-step agent run
In a 12-step agent run, output is 1.8% of the bill and re-sent input is 98%. A per-step token model across 6 models. Prices verified 2026-07-19.
In a 12-step agent task, the model generates 7,200 output tokens and gets billed for 409,800. Output is 1.8% of the bill. The other 98.2% is the same context re-sent every step: a 15,000-token scaffolding slab repeated 12 times, plus history that grows until the final call re-sends 50,600 tokens to produce 600. Prices verified 2026-07-19. This post builds the per-step model so you can see which steps burn what, and where caching flips the math.
TL;DR
- One 12-step agent run bills 402,600 input tokens and 7,200 output tokens. The output tokens the agent actually writes are 1.8% of the total; re-sent input is 93.9% (scaffolding + history).
- You pay for 7.6x the unique information in the task. The run contains 53,700 distinct tokens; re-sending them every step bills 409,800.
- Uncached, that one task costs $2.19 on [Claude Opus 4.8](https://vynaris.com/models#claude-opus-4-8) and $0.058 on [deepseek-v4-flash](https://vynaris.com/models#deepseek-v4-flash), a 38x spread. Prompt caching cuts each Anthropic bill by 69%, and cache reads become the largest input line by step 10.
What we computed, and why
People ask why one agent task costs the equivalent of 3 to 40 plain model calls. The answer is not that the model is thinking 40 times harder. It is that an agent re-sends its whole context window on every step, and the bill tracks re-sent input, not generated output.
A recent measurement made the shape concrete: one popular coding agent sends about 33,000 tokens of scaffolding before it reads your prompt; a leaner one sends about 7,000 (Hacker News, 704 points, 2026-07-19). That is the fixed cost per call. On top of it sits history that grows every step. We modeled both together across a 12-step run so the per-step breakdown is visible, not averaged away.
The goal is not one true number. It is a transparent skeleton you can re-run with your own token trace. Every figure below comes from a script; nothing was computed by hand.
The assumptions (edit these)
Every value here is an input you can change. The run is one bug-fix or small-feature task, structured as plan, then a loop of read, edit, run tests, read output, patch.
Assumption Value Note
---------------------- ------------- --------------------------------------------------------
Scaffolding per call 15,000 tokens system prompt + tool schemas, re-sent every step
Task prompt 1,500 tokens the request, present from step 1
Steps (model calls) 12 one agent task
History added per step 3,100 tokens prior tool result (2,500) + prior assistant output (600)
Output tokens per step 600 reasoning summary + tool callThe input-to-output ratio is the whole story. An agent that re-sends a growing prompt every step is almost entirely an input workload, so anything that lands on input tokens lands on nearly the whole bill. Chat apps rarely look like this. Agents look like this by construction.
Where the tokens go, step by step
Here is the input composition of each call. Scaffolding is a flat slab; history climbs; the output the agent produces is the thin band on top.
Step Input re-sent Scaffolding History Output
----- ------------- ----------- ------- ------
1 16,500 15,000 0 600
2 19,600 15,000 3,100 600
4 25,800 15,000 9,300 600
6 32,000 15,000 15,500 600
8 38,200 15,000 21,700 600
10 44,400 15,000 27,900 600
12 50,600 15,000 34,100 600
Total 402,600 180,000 204,600 7,200
Two lines carry the cost. Scaffolding re-send is 180,000 tokens (43.9% of the billed total), the same 15,000-token block paid for 12 times. History re-send is 204,600 tokens (49.9%), because each tool result, once appended, is re-sent on every later step. The task text adds 18,000 (4.4%). Output is 7,200 tokens, 1.8%.
That is the answer to the 3-to-40-calls question. The task's unique content is 53,700 tokens: 15,000 scaffolding written once, 1,500 task, twelve 2,500-token tool results, twelve 600-token outputs. You are billed 409,800. The re-send tax is 7.6x.
What one task costs across six models
Same token counts, uncached, per task and per 1,000 tasks. Prices verified 2026-07-19.
Model Input $/1M Output $/1M Per task Per 1,000 tasks
----------------------------------------------------------------- ---------- ----------- -------- ---------------
[Claude Opus 4.8](https://vynaris.com/models#claude-opus-4-8) $5.00 $25.00 $2.1930 $2,193.00
[gpt-5.6-terra](https://vynaris.com/models#gpt-5-6-terra) $2.50 $15.00 $1.1145 $1,114.50
[Claude Sonnet 5](https://vynaris.com/models#claude-sonnet-5) $2.00 $10.00 $0.8772 $877.20
[gpt-5.6-luna](https://vynaris.com/models#gpt-5-6-luna) $1.00 $6.00 $0.4458 $445.80
[Claude Haiku 4.5](https://vynaris.com/models#claude-haiku-4-5) $1.00 $5.00 $0.4386 $438.60
[deepseek-v4-flash](https://vynaris.com/models#deepseek-v4-flash) $0.14 $0.28 $0.0584 $58.38The spread is 38x from top to bottom for identical work. Because the workload is 98% input, a model's input price sets its rank. Opus 4.8 and gpt-5.6-terra are expensive here not because their output is dear but because you re-send hundreds of thousands of input tokens at $5 and $2.50 per million. Luna and Haiku 4.5 land within a whisker of each other at the input line that matters.
If you are sizing an agent budget, this is the point to plug in your own numbers: run your per-step token trace through the calculator and watch the input line dominate before you commit to a model.
Caching: where cache reads take over
The scaffolding and the accumulated history are a stable prefix. That is exactly what prompt caching is for. Anthropic's published multipliers are a 1.25x write for the 5-minute cache and a 0.1x read on hits (verified 2026-07-19). Model the run incrementally: step 1 writes the seed prefix; each later step reads everything it has seen at 0.1x and writes only the 3,100 new tokens at 1.25x.
Uncached $/1k tasks 5-min cached $/1k tasks Saved
---------------- ------------------- ----------------------- -----
Claude Opus 4.8 $2,193.00 $672.25 69%
Claude Sonnet 5 $877.20 $268.90 69%
Claude Haiku 4.5 $438.60 $134.45 69%The interesting mechanics are inside the run. Total cache-read tokens across the 12 steps are 352,000; total cache-write tokens are 50,600. Priced at 0.1x versus 1.25x, the per-step read cost overtakes the per-step write cost at step 10, when the re-sent context reaches about 41,300 tokens. Past that point most of your input bill is cache reads, not fresh writes. The re-send tax does not disappear with caching; it drops by 90% per token and then compounds again as the prefix grows. This is the same prefix-heavy shape we costed in what a coding agent costs per task, and the break-even math for caching sets the hit rate where the 1.25x write pays for itself.
What it means for routing
The per-step model turns three levers you can actually pull.
- Cut the scaffolding, not just the model. Scaffolding is 180,000 of the 402,600 input tokens here. Halving a 15,000-token preamble to 7,500 removes 90,000 re-sent tokens from the task, worth $0.45 on Opus 4.8 before you touch caching. The 33k-versus-7k scaffolding gap is the single largest controllable line, and it is provider-independent.
- Cache the prefix or accept the 7.6x tax. An uncached agent re-buys its own history every step. On a stable prefix, caching is the difference between $2,193 and $672 per 1,000 Opus 4.8 tasks. If your steps fall outside the 5-minute window, the write premium repeats and the saving shrinks; keep the loop tight.
- [Right-size](https://vynaris.com/glossary/right-sizing-models) per step, not per task. Most of the 12 steps are read, run, and patch, not the one hard plan step. Model routing that sends the plan to Opus 4.8 and the mechanical steps to Haiku 4.5 or deepseek-v4-flash attacks the 38x spread where it is widest. An OpenAI-compatible gateway lets you test that split without rewriting provider glue.
Where this model is wrong
Honesty first, because a cost model that hides its failure modes is marketing.
- Real traces are lumpier. We used a constant 3,100-token growth and 600-token output per step. A real run has a heavy read step, a quiet verify step, and one plan step that generates far more output. The totals hold on average; any single step can differ by 2x.
- Anthropic's newer models bill more tokens for the same text. Opus 4.8 and Sonnet 5 use a tokenizer that produces roughly 30% more tokens than the previous one (provider note, verified 2026-07-19). We priced identical token counts across all models to isolate structure. On identical source text, the two Anthropic models bill about 30% more than the count shown here; the tokenizer surcharge post has the adjustment.
- Caching assumes hits. The 69% saving needs the prefix to stay cached across steps. A cache miss on any step re-bills that read at the full 1x rate. Bursty or slow agents get less.
- Long context can add a second surcharge. This run peaks at 50,600 tokens, under every provider's long-context threshold. An agent whose context grows past 200,000 tokens hits the long-context re-rate on some models, on top of the re-send tax modeled here.
When is the expensive model still right? When the one plan step decides the whole task. If Opus 4.8 solves in 12 steps what Haiku 4.5 needs 30 steps and two dead ends to solve, the cheaper per-task rate loses to the step count. Route by which step needs the reasoning, not by the sticker price.
FAQ
Why does one agent task cost far more than one model call? Because an agent makes many calls, and each call re-sends the whole context. In this 12-step model the agent bills 402,600 input tokens to generate 7,200 output tokens. The task's unique content is 53,700 tokens; re-sending it every step multiplies the bill 7.6x.
What share of an agent's bill is output? About 1.8% here. Agents are input workloads. The scaffolding re-send (43.9%) and the accumulated history re-send (49.9%) are the bill; generated output is a sliver.
Does prompt caching fix it? It cuts the Anthropic bill by 69% in this model, from $2,193 to $672 per 1,000 Opus 4.8 tasks. Caching lowers the re-send cost per token by 90% on hits; it does not remove the re-send, so the cost still grows with the prefix. Cache reads become the largest input line by step 10.
Which is cheaper for agents, a frontier or a cheap model? On identical token counts the spread is 38x (Opus 4.8 $2.19 versus deepseek-v4-flash $0.058 per task). But a cheaper model that needs more steps or retries can erase that gap. Route the hard step to the strong model and the mechanical steps to the cheap one.
Sources
- Anthropic pricing (Opus 4.8, Sonnet 5, Haiku 4.5, cache multipliers, tokenizer note), captured 2026-07-19: https://platform.claude.com/docs/en/about-claude/pricing
- OpenAI API pricing (GPT-5.6 Terra, Luna), captured 2026-07-19: https://developers.openai.com/api/docs/pricing
- DeepSeek API pricing (v4-flash), captured 2026-07-19: https://api-docs.deepseek.com/quick_start/pricing
- Scaffolding-overhead measurement, Hacker News 704 points, 2026-07-19: https://news.ycombinator.com/item?id=48883275
- Cost model script and per-step arithmetic: from the assumptions table above.
Prices change. We re-verify every figure in this post monthly and stamp updates. Numbers here are current as of 2026-07-19.
Want the same math on your own workload? Vynaris is an OpenAI-compatible gateway that routes each request to the cheapest right-sized model and shows the per-request cost, including the input line an agent loop re-sends every step. One base URL swap. Get an API key at vynaris.com.