The agentic AI token usage crisis is usually structural, not bad luck. A single chat completion can be cheap, but the same job run through agentic AI or multi-step AI agents gets expensive fast because the loop keeps sending its growing context back on every step, which pushes token consumption up far beyond one call.
If you’re a developer who just opened an invoice and thought the usage looked impossible, you’re in the right place. This page works through the arithmetic, shows the four cost drivers you actually control, and explains when to skip the agent entirely, because recurring runs and repeated tool calls can burn through budget in a few days before the pattern is obvious.
Why Agent Loops Cost So Much More Than One Call
An agent re-sends its accumulated context on every step, so total input tokens grow with the square of the step count rather than linearly, which is why the same task can cost far more as an agent than as one call. In practice, each turn can ship 16,000 to 26,000 input tokens before the real instruction even starts, so the expensive part of agentic AI is often the loop itself, not the difficulty of the work.
That is also why cost per call misses the real number. A single inference call is priced once, but an agent run is priced across many turns, with the same context toll paid again and again as the session grows.
To estimate your AI token cost, use this calculator.
The four places tokens accumulate
Tokens pile up in four predictable places inside an agent loop. Once you see them separately, the cost jump stops looking random.
- System prompt and tool definitions get re-sent on every step, which creates a fixed overhead even before the agent does any useful work.
- Conversation history grows over time, so each new turn carries more prior context than the one before it.
- Tool outputs come back into context as fresh input, and big payloads can make token consumption climb fast.
- Retries after failures add extra turns, which means the agent pays the same context cost again for the retry.
The common pattern is repetition. An agent is not paying only for the latest instruction, it’s paying for the whole running state of the session every time it thinks, calls a tool, or tries again.
The short version of the arithmetic
Double the steps, and input token cost can roughly quadruple. That happens because step 2 includes step 1’s context, step 3 includes steps 1 and 2, and the agent keeps dragging more history forward on every turn.
So the useful unit is not cost per prompt, but cost per completed run. If you want the step-by-step derivation of why this goes quadratic in agentic ai, the next section breaks the arithmetic down cleanly.
The Quadratic, Derived Step by Step
The quadratic shows up when an agent pays input cost on a growing transcript, not just on the new instruction for that turn. If a run keeps re-sending the same prefix, prior messages, and tool output back into each inference, the bill grows from the sum of 1 through N, not from N alone.
Fix the stable prefix first
Start with the part that gets sent on every turn: the system prompt, tool schemas, and any standing instructions. Call that P tokens.
P = system prompt + tool definitions + fixed rules Turn input = P + prior history + new user/task text + latest tool result(s)
Model the growing transcript
Now assume each turn adds roughly h new transcript tokens that will be re-sent next time. That addition can be model output, tool output, or both.
Turn 1 input ≈ P + h Turn 2 input ≈ P + 2h Turn 3 input ≈ P + 3h ... Turn N input ≈ P + Nh
Sum all input across the run
Total input tokens are the sum of every turn’s input, not the final turn alone. That is where the quadratic appears.
Total input ≈ N·P + h(1 + 2 + 3 + ... + N)
≈ N·P + h·N(N+1)/2
Check it with 10 turns
Use a simple example a reader can verify by hand: P = 2,000 tokens and h = 800 tokens per turn over N = 10 turns.
Total input ≈ 10·2,000 + 800·10·11/2
≈ 20,000 + 44,000
≈ 64,000 input tokens
Compare that with one good call
If the same job can be done in one pass, you pay the prefix once and the supporting context once. That makes the comparison concrete.
Single-call input ≈ P + task context + attached evidence Example: 2,000 + 8,000 = 10,000 input tokens Agent run input ≈ 64,000 input tokens Difference ≈ 6.4x on input before output pricing is added
What each turn re-sends
Each turn re-sends the stable prefix plus everything the model still needs in context to continue. In a typical loop, that means the system prompt, tool definitions, prior user and assistant messages, and the latest tool results.
So the shape is simple: turn 1 is small, turn 10 is not. If each step adds 800 tokens of history, then a 10-turn run sends 2,800 tokens on turn 1, 3,600 on turn 2, and 10,000 on turn 10 when P = 2,000.
| Turn | Input formula | Input tokens |
|---|---|---|
| 1 | 2,000 + 800 | 2,800 |
| 2 | 2,000 + 1,600 | 3,600 |
| 3 | 2,000 + 2,400 | 4,400 |
| 4 | 2,000 + 3,200 | 5,200 |
| 5 | 2,000 + 4,000 | 6,000 |
| 6 | 2,000 + 4,800 | 6,800 |
| 7 | 2,000 + 5,600 | 7,600 |
| 8 | 2,000 + 6,400 | 8,400 |
| 9 | 2,000 + 7,200 | 9,200 |
| 10 | 2,000 + 8,000 | 10,000 |
One detail matters more than most teams expect: tool output format changes the slope. JSON adds brackets, quotes, commas, and keys as extra token overhead, while plain text or a tight markdown table can cut that roughly in half when the model does not need strict structure.
Working it with live per-token rates
The math is easiest to trust once you put a live rate on it. Using the current flagship rates in the provided August 2026 pricing data, GPT-5.6 Sol is $5.00 per million input tokens and $30.00 per million output tokens, while Claude Opus 5 is $5.00 input and $25.00 output.
Apply that to the 10-turn example above and the input cost stays modest by itself. At $5.00 per million tokens, 64,000 input tokens cost about $0.32, while a 10,000-token single call costs about $0.05.
| Scenario | Input tokens | Rate per million tokens | Input cost |
|---|---|---|---|
| Single call | 10,000 | $5.00 | $0.05 |
| 10-turn agent loop | 64,000 | $5.00 | $0.32 |
But input usually is not the part that hurts most. Output costs 3 to 5 times more on major providers, so a looping agent that keeps producing verbose reasoning, summaries, or reformatted tool output can outrun the prompt-side savings fast. For a clean breakdown of that split, see input vs output tokens.
The crossover point against a single call
A single well-constructed call beats an agent when the task does not need new external state between steps. If the model can answer from one packed context window, one prompt, and one bounded response, the agent loop is usually pure token cost.
The practical crossover point is easy to spot. If later turns are mostly re-reading earlier context, reformatting tool results, or asking the model to restate what it already has, stop looping and collapse the job into one call.
Use this test:
- The task can be specified upfront in one prompt.
- The needed documents can be attached once.
- No step depends on a fresh API lookup or user choice mid-run.
- The model is revising phrasing, not discovering new facts.
- The transcript is growing faster than the task is changing.
If most of those are true, the crossover has already happened. One good call beats ten polite retries.
The Four Cost Drivers Ranked by How Much You Control
The biggest agent cost levers are mostly operator-controlled, not provider-controlled. If you rank them by how much control a developer actually has, tool-result verbosity, history retention policy, and model choice sit at the top, while tool-definition size matters but is usually the slower lever.
| Driver | Control | Typical cost impact | Why it compounds in the loop | Lever exposed |
|---|---|---|---|---|
| Tool-result verbosity | High | High | Raw JSON and long API returns get stored, then re-fed into later agent turns | Decide how much tool output the model sees |
| History retention policy | High | High | Each step can resend more prior messages, state, and intermediate work | Decide what stays in working context |
| Tool-definition size | Medium | Medium | Large tool schemas and instructions can ride along on repeated calls | Decide how much tool metadata ships each time |
| Model choice | High | High | The same loop multiplies whichever per-token price and latency profile the model has | Decide which model does which step |
Tool-result verbosity
Tool-result verbosity is usually the fastest cost win because oversized outputs keep getting paid for more than once. When an analytics API, database query, or scraper returns raw JSON, that payload often becomes part of the running transcript and gets reprocessed on later steps, which multiplies cost inside the loop rather than at one isolated call.
The lever here is simple to spot even before you change anything: look at what your tools return to the model, not just what the tool fetched from the external system. If the agent only needed three fields but got fifty, the extra tokens didn’t just cost one turn.
History retention policy
History retention policy is a high-control driver because the transcript only grows when you let it. An agent that keeps every scratchpad thought, tool trace, and intermediate answer in live context turns a short task into a long-running input bill.
Why does this compound so hard? Because every new step can drag old state back into the next model call, even when only a small slice is still useful. That’s where the quadratic behavior from s3 starts to show up in practice.
Tool-definition size
Tool-definition size matters most when the agent carries a large catalog of tools or verbose schemas into repeated calls. The cost isn’t just the existence of tools, it’s the repeated shipping of long descriptions, parameter definitions, and instructions that the model has to read again.
This is a medium-control lever because some tool overhead is structural. Still, if your agent has ten tools available for a task that only needs two, you’ve created input cost before the work even starts.
Model choice
Model choice is a high-control driver because the same workflow can be cheap or expensive depending on which model handles each step. Frontier models are often used by default for routing, formatting, or classification work that a cheaper model could do the same way.
In enterprise settings, this gets missed because teams focus on prompt price instead of cost per completed task. The loop is what multiplies the decision, so an overpowered model in the wrong step becomes a system-level tax.
Mitigations That Actually Reduce Agent Token Spend
The fixes that work are simple: shrink what the agent sees, shorten how long it remembers, cache what doesn’t change, use a cheaper model for routine work, and stop the loop before it runs away. In practice, most savings come from cutting repeated input and unnecessary output, because that’s where agent costs compound at scale.
Truncate and summarize tool output
Raw tool output is one of the fastest ways to bloat context, especially in coding and search-heavy agents. Return only the fields the next step actually needs, strip verbose JSON, and summarize long results into short LLM-friendly text plus any exact values that must survive.
Prune conversation history
A capped history policy keeps context from growing on every turn. The usual pattern is to rotate older turns into a short summary or switch to a more stateless design, but the trade-off is real: if the agent depends on earlier tool results or exact prior reasoning, aggressive pruning can break behavior instead of just reducing cost.
Cache the stable prefix
Prompt caching cuts repeat input cost when the stable prefix stays identical across turns. System instructions, tool definitions, project context, and early messages are the usual candidates, and the reason this matters is arithmetic: a cache miss costs 12.5 times a cache hit for the same prefix, so changing a tool definition mid-session can re-bill the full cached context at the expensive rate.
Route sub-steps to a cheaper model
Model routing is the highest-yield optimization after obvious prompt cleanup. Use a stronger model only for the hard judgment calls, and send routine classification, extraction, formatting, or coordinator work to a cheaper model, because that split has repeatedly cut spend by roughly 60% to 90% without a visible drop in output quality for routine sub-steps.
Set a hard step cap
A hard step cap is the last line of defense when agents get stuck, loop, or keep expanding the same context. Set a maximum number of turns per task, cap output length with max_tokens, and fail fast once the budget is spent instead of letting one bad run keep billing itself into the next hour.
For planning runs before you ship them, a token estimator helps you put numbers on step limits, history size, and output caps before they hit production.
When a Single Call Beats an Agent
A single well-constructed call beats an agent when the task has a fixed path, a known input shape, and one response-sized output. That is where the agent framing gets over-applied: teams hand decision-making to a loop that does not need to decide anything, then pay extra tokens for branching, replayed context, and failure modes that a simple workflow could have avoided. In practice, a lot of supposed agent work is just structured automation plus one LLM step, and that simpler setup is usually cheaper, easier to test, and easier for a human to trust.
Use this test. If there are no mid-task decisions, no need to inspect tool results to choose the next action, and the full answer fits in one response, do not build an agent. Use one call, or a plain workflow with one model step inside it. This also lines up with the crossover point from s3: once the loop starts re-sending history across multiple turns, the cost curve stops looking small very quickly. If the next step is already known before the model answers, the loop is overhead, not intelligence.
Enforcing Budgets Before the Next Bill
Budget enforcement has to refuse the request, not email someone after the spend already happened. Teams that get burned usually had alerts, dashboards, or shared API keys with weak attribution, but no hard stop when an agent crossed its limit. That is why daily, weekly, or per-person caps work: they change behavior before unrestricted usage turns into an AI budget problem. If you need the basics first, What Is a Token in AI Large Language Models is the clean foundation, and input vs output tokens is the detail that usually explains where spend actually went.
The cheaper move is to price the workload before you build it. Once an agent feature ships, reconstructing cost means untangling model choice, loop length, context growth, and tool chatter after the invoice lands. Do the arithmetic first, set the cap second, then ship.
Estimate your AI token costs instantly ⇒
Frequently Asked Questions
Why do AI agents use so many more tokens than a chatbot?
AI agents use more tokens because they keep re-sending prior context and tool output on each step, so the total input can grow quadratically instead of call-by-call. A normal chatbot exchange is often short and bounded, but an agent loop can turn one task into 10, 20, or 50 model calls that each carry a larger transcript than the last.
That is why the bill jumps even when each individual call looks cheap. The expensive part usually is not one reply, it’s the repeated accumulation.
How can I cap agent token costs without breaking the agent?
Cap agent spend by setting a hard step limit and pruning history aggressively enough to stop transcript growth. Those two controls work because they attack the two failure modes that drive most cost: too many turns and too much old context carried into each turn.
But pruning has a real trade-off. If the agent depends on earlier tool results, long-running reasoning, or retrieved context from step 7 showing up again at step 14, cutting history too hard can break the behavior you were trying to preserve.
Does prompt caching actually reduce agentic AI costs?
Yes, prompt caching can reduce agentic AI costs materially when the agent keeps sending the same stable prefix, such as the system prompt or fixed tool definitions. The win comes from the gap between a cache hit and a cache miss, so the savings are large only when that prefix stays identical across repeated calls.
The catch is simple: tiny dynamic fields can kill the cache. A timestamp, session ID, or changing date inside the cached prefix can turn an expected discount into almost no discount at all.
How many steps before an agent is not worth it?
An agent stops being worth it at the point where the extra steps add more token cost than decision quality. In practice, the crossover happens sooner than teams expect when each step re-sends a growing history, which is why the step count alone is not the right metric.
Look at the task shape instead. If the work has a fixed path, predictable input, and one bounded output, a single call usually wins well before a long agent loop does.
Are cheaper models enough for routine agent tasks?
Cheaper models are usually good enough for repetitive, structured agent tasks like classification, routing, extraction, and simple tool selection. They tend to hold up when the task has a narrow format and a clear success condition.
They fall off faster on creative work, novel debugging, and messy multi-step judgment. Some builders also test models on real agent task flows instead of static leaderboards, because a model that looks strong on benchmarks can behave very differently once tools, retries, and long context are involved.