A team reports that their agent costs a few cents per request and concludes it is cheap. Then the invoice arrives an order of magnitude higher than the projection, because the metric they measured was cost per model call and the thing they were billed for was cost per attempted task, including the sixty percent that failed and retried.
Getting this number right is the difference between an agent program that survives budget review and one that does not.
What changed in 2026
- Cost per outcome replaced cost per token in reporting. As agent deployments matured, finance teams started asking for the unit that maps to business value.
- Context growth got quantified. Teams measured how prompt size compounds across an agent run and found later steps costing several times what early steps did.
- Reasoning budgets entered the calculation. With thinking effort configurable per call, the same agent could vary in cost by a large multiple depending on settings nobody was tracking.
- Human review time entered the comparison. Honest ROI analysis began including the cost of verifying agent output, which changed several conclusions.
Building the real number
| Component |
How to measure |
| Tokens on successful runs |
Sum input and output across all steps |
| Tokens on failed runs |
Same, then attribute to the eventual success |
| Retry multiplier |
Total attempts divided by successes |
| Reasoning tokens |
Often billed as output; check your provider |
| Tool call costs |
External API charges, search, database queries |
| Human review time |
Minutes per output times loaded hourly cost |
| Infrastructure |
Orchestration, storage, observability |
The formula that matters is total spend over a period divided by successful outcomes in that period. Not per call, not per run — per outcome. If three attempts produce one usable result, the cost of that result is three attempts.
Where the money actually goes
Step count dominates. An agent that solves a task in four steps and one that takes twelve differ by roughly threefold in cost, which is a larger factor than most model tier differences. Reducing loops is therefore the highest-leverage optimization, and it is usually achievable through better tool descriptions and clearer termination conditions rather than a more expensive model.
Context growth is the multiplier on top. Every tool result stays in the prompt for subsequent steps, so step ten is reading everything from steps one through nine. Cost per step rises through the run, which means a long run is more expensive than step count alone suggests. Periodic compaction — replacing accumulated history with a structured summary — cuts this and improves quality at the same time, since it also addresses context rot.
Reasoning budgets are the setting people forget. A high thinking effort applied to every step of a twelve-step run multiplies through the whole thing. Apply it selectively, as covered in test-time compute explained.
Instrumenting all of this requires per-run tracing rather than aggregate billing — see AI agent observability for the spans that make cost attributable.
Common mistakes
- Dividing by attempts instead of successes. Understates the true cost, sometimes severely.
- Optimizing the model before the loop. Step count usually matters more than tier.
- Ignoring context growth. Later steps cost more, and averaging hides it.
- Excluding human review from the comparison. An agent requiring full verification has automated less than it appears.
- No cap on steps. An occasional non-terminating run can consume a meaningful share of the monthly budget by itself.
FAQ
What is a reasonable cost per task?
Entirely task-dependent. The useful comparison is against the human cost of the same task, including review, not against an absolute figure.
How do I attribute failed runs?
Divide total period spend by successful outcomes in that period. That automatically distributes failure cost across successes without per-run accounting.
Does a cheaper model always reduce cost per task?
No. A cheaper model that needs more steps or fails more often can cost more per successful outcome. Measure the outcome, not the rate.
What is the fastest way to cut agent cost?
Cap steps, compact context, and fix the tool descriptions causing repeated calls. All three are cheap and usually produce a larger reduction than switching models.
Where to go next
For instrumentation, read AI agent observability. For the levers, AI model routers explained and batch inference cost savings.