Delve · Field guide
The Real Unit Economics of an AI Agent
Token price is a supplier metric. What decides whether an agent works is cost per successful outcome, after retries and human rescue.
Delve Editorial · AI Engineering · 10 min
#unit-economics #cost-per-outcome #evaluation #human-in-the-loop #model-routing
The short answer
The real unit economics of an AI agent is cost per successful outcome, not cost per token or per call: total variable spend — inference, tool calls, retries, and human rescue — divided by the share of tasks the agent actually completes to standard. Agents look cheap per token and expensive per resolution because failures cost money and long loops consume context.
The denominator you choose changes the decision you can make. Cost per token negotiates with a vendor; cost per task plans capacity; cost per resolution sets price and margin. Teams that price per seat while measuring per token routinely discover that their heaviest users are unprofitable and their light users are subsidizing them.
- Core metric Cost per successful outcome
- Run-to-run token spread Up to 30x on the same task
- Cost driver Input tokens, not output
01 · The denominator
Pick the denominator before you pick the model
The same agent can be described as costing a fraction of a cent per thousand tokens, $0.60 per task, $1.40 per successful resolution, or $30 per seat per month. These are not four views of one number; they are four different businesses. Token price is a supplier's metric — it tells you what the model vendor charges, not what your workflow pays. Cost per task captures one run but treats a failed run and a completed one as equivalent. Cost per successful resolution divides total spend by outcomes that met the standard, the only figure directly comparable to a human's fully loaded cost .
Success rate belongs in the denominator because failed runs are not free. If an agent costs $0.30 per attempt and resolves 60% of tickets first time with no retry, cost per resolution is $0.50, not $0.30. At a 40% success rate it is $0.75, before any rework. Failures burn tokens and tool calls, and they often consume a human's time to detect and correct . The asymmetry matters: a $0.90 run that succeeds beats a $0.10 run that fails twice and then escalates.
Task-level dispersion is large enough to swamp token-price comparisons. In one published benchmark comparison, a coding agent scored 68 on a composite index at $14.19 and 27.7 million tokens per task, while a rival scored 63 at $1.04 and 3.2 million tokens — roughly a 14x cost gap for a five-point score difference, with different token-efficiency behavior on the same tasks . Whether the expensive agent is worth it depends on what a solved task is worth to you, a business question the price sheet cannot answer.
A failed run is not a discount. It is a cost with no output.
Cost per seat is the weakest denominator for agent products: it is predictable to bill and nearly silent about usage intensity.
02 · The cost stack
Inside one run: where the money actually goes
An agentic coding task consumes roughly three orders of magnitude more tokens than code chat or single-shot reasoning, and input tokens, not output, drive the bill . The mechanism is cumulative context: every turn re-sends the system prompt, tool schemas, prior messages, and retrieved files, so a thirty-step run pays for the same prefix thirty times unless caching absorbs it. Output and reasoning tokens carry higher per-unit prices but are the smaller share of the total.
Variance is where the economics live. Across eight frontier models on identical tasks, runs differed by up to 30x in total tokens, and accuracy peaked at intermediate cost rather than climbing with spend . Failed trajectories were consistently more expensive than successful ones on the same tasks: models keep exploring, re-reading, and retrying when they cannot recognize a task as unsolvable, and the size of that excess is model-specific . That inverts the intuition that a failed run is a cheap run.
Token counts are also not prices. Providers bill input, cached input, output, reasoning, and tool units at separate rates, then add batch discounts and per-search or per-execution tool fees . A componentized ledger — input, cached input, output, reasoning, tool units, discounts, retries — is the minimum viable instrument, because one blended cost per token hides exactly the terms that move under load .
Every turn re-reads the accumulated context, so a long loop buys the same prefix again and again.
The token-consumption evidence comes from coding agents on SWE-bench Verified; office and research agents may loop differently.
03 · Hidden labor
The bill outside the model: oversight, evals, recovery
Every production agent carries a second cost center: the people and systems that catch its mistakes. Human review, escalation handling, eval harnesses with judge-model calls and labeled gold sets, guardrails, monitoring, and incident recovery all sit inside the fully loaded cost of a resolved task . In high-stakes workflows these can exceed token spend, because the cost of detecting a confident wrong answer usually exceeds the cost of producing it.
Oversight cost scales with stakes and failure visibility, not with token volume. An agent resetting passwords needs spot checks; an agent issuing refunds or editing production code needs per-action review or a validated test harness. The escalation boundary is a design decision with a price: routing the hard 30% to humans concentrates human time exactly where the agent is weakest, and the human still needs the agent's context, so a bad handoff can cost more than no agent at all.
Eval cost behaves differently from inference. It is roughly fixed per change rather than per transaction, which makes it punishing at low volume and dilutive at high volume. A team shipping weekly pays for regression suites on every prompt change; a team running a frozen agent pays once . That is why pilots almost always look worse per outcome than mature deployments, and why cost-per-resolution claims from vendor case studies should be read as best-case: escalation rates and oversight ratios are the least-disclosed inputs.
Detecting a confident wrong answer usually costs more than producing it.
Public disclosure of human-in-the-loop ratios is rare, so most published cost-per-resolution figures are vendor-selected.
04 · Boundary conditions
Why cost per outcome falls, then stops falling
Average cost per task does fall with engineering. Prefix caching converts repeated context into cheaper cached-input rates, batch APIs take roughly 50% off for latency-tolerant work, model routing sends easy steps to smaller models, and better stop conditions shorten loops . Each lever attacks one term in the stack rather than the headline token price — which is why cache hit rate and routing mix, not the vendor's rate card, are the numbers to watch.
The floor is set by the tail, not the average. Task cost and task success are both heavy-tailed: a minority of tasks generates most of the tokens, and the same task can cost far more on a rerun . Capacity planning and pricing must survive that tail, so budget follows the ninety-fifth percentile, not the mean.
Two brakes on further reduction. First, accuracy saturates: beyond an intermediate token budget, extra spend buys little, so routing down is often safe on bulk traffic but fails on the tail where competence runs out . Second, agents cannot forecast their own cost — frontier models predict token use only weakly and systematically underestimate it, so per-task quotes are unreliable without measured traces .
Cheaper tokens also expand scope. As per-token prices decline, teams assign harder, longer-horizon tasks, so observed cost per task can rise while underlying prices fall. The number that matters for planning is cost per resolution on your current task mix — a moving target.
Cheaper tokens invite harder tasks, so cost per task can rise while price per token falls.
Vendor claims of large cost reductions usually describe a specific workload mix and should be re-measured on your traces.
05 · Margin math
Margin math: pricing an agent you can afford to run
Contribution margin per outcome is price per outcome minus inference, tool fees, allocated oversight, and allocated infrastructure and eval cost. Every pricing model is a choice about who carries which risk:
- Usage pricing passes volume risk to the customer; margin is a markup and stays thin and volatile. - Per seat is predictable, but decouples revenue from cost, so heavy users run unprofitable. - Per outcome aligns price with value, but the vendor absorbs failure and retry cost — which is why the success rate must be measured before signing.
Take a support agent priced per resolution. If the blended variable cost of an autonomous resolution is $0.50 and 30% of attempts escalate to a human whose time costs $6, cost per resolution is roughly $0.50 + 0.3 × $6 ≈ $2.30 before infrastructure and eval allocation. At a $4 price that is a 43% gross margin; at a 10% escalation rate cost falls to about $1.10 and margin rises to roughly 72%. These figures are illustrative arithmetic rather than observed benchmarks, and the point is the sensitivity: escalation rate, not token price, moves margin most.
The strongest caveat is data quality. Vendors rarely disclose cost per resolution, gross-margin statements aggregate across products, and the sharpest public cost-per-task comparison is a benchmark harness, not a production invoice . Treat any external cost-per-outcome figure as a hypothesis to re-measure on your own traces before it enters a price.
Escalation rate, not token price, moves margin most.
Outcome-based contracts need an explicit definition of success, a dispute process, and usually a cap on the vendor's absorbed retry cost.
Four denominators, four decisions
Each unit answers a different question and hides a different risk.
| Unit | What it measures | What it hides | Use it for |
|---|---|---|---|
| Cost per token | Vendor rate card | Loop length, retries, tools | Vendor negotiation |
| Cost per task | One agent run | Whether the run succeeded | Capacity and latency planning |
| Cost per resolution | Spend divided by outcomes met | Tail cost and oversight depth | Pricing and margin decisions |
| Cost per seat | Predictable headcount billing | Usage intensity per user | Internal chargeback |
| Price per outcome | Contract revenue per success | Failure and rework absorbed by vendor | Enterprise deals with defined success |
Common misconceptions
- A cheaper model per token always produces a cheaper agent Token efficiency and loop behavior dominate. On identical coding tasks, some frontier models consumed over 1.5 million more tokens on average than the most efficient one, erasing any per-token price advantage [S2].
- Giving the agent a bigger token budget improves results Accuracy tends to peak at intermediate cost and then saturate, while failed runs consume more tokens than successful runs on the same task [S2][S4].
- The model bill is the agent's cost Oversight, eval harnesses, monitoring, and escalation recovery sit outside the invoice and can dominate in high-stakes workflows [S3].
- Falling token prices mean agents get cheaper every quarter Teams respond by assigning harder, longer-horizon work, so cost per task can rise even as per-token prices fall [S2][S4].
Build a cost-per-resolution model from your own traces
You cannot price or scope an agent from a rate card; you need a measured distribution.
Instrument every run
Log input, cached input, output, reasoning, tool units, retries, model and prompt version, and the outcome of each task using a componentized ledger rather than a blended rate .
Define success in writing
Specify what counts as an autonomous resolution, an assisted completion, and a failure. The denominator is a policy decision, and changing it silently changes your margin.
Price the rescue path
Measure escalation rate and fully loaded human minutes per escalation, including context handoff time. Multiply; that product often exceeds the model bill.
Report p50 and p95 cost per task
Publish the cost distribution, not just the mean. Heavy tails drive budget overruns and make per-task quotes unreliable .
Evaluate on failure-heavy traffic
Since failed runs cost more, test on the tasks the agent currently fails. A model that looks efficient on the head of the distribution may be the expensive one on the tail .
What would change my mind: Measured traces showing frontier agents forecast their own token cost within a small margin, and that success-adjusted cost per resolution stays below human cost across the full task distribution rather than just the easy head, would make token-price planning reliable again.
Recall check
An agent costs $0.30 per attempt and succeeds on 60% of tasks with no retries. What is the approximate cost per successful task?
- $0.18
- $0.30
- $0.50
- $0.90
Divide cost per attempt by the success rate: $0.30 ÷ 0.6 = $0.50. Failed attempts still consume tokens, so they must be paid for by the successes.
A team doubles an agent's token budget and benchmark accuracy moves up two points. What does the token-consumption evidence suggest?
- Accuracy scales linearly with token spend
- Extra budget typically yields diminishing accuracy returns and can saturate
- Token use and accuracy are unrelated at every budget level
- Only the vendor's per-token price determines accuracy
Accuracy tended to peak at intermediate cost and then flatten, so additional spend often buys little — and failed runs were more expensive than successful ones.
Which cost is most likely to dominate a high-stakes agent that autonomously resolves 60% of tasks?
- Cached input tokens
- Per-search tool fees
- Batch processing discounts
- Human review and escalation handling
At a 40% non-autonomous rate, human time per escalated task usually exceeds the token bill, especially when handoffs require reading the agent's context.
Open questions
- How fast does human oversight time fall as agent success rates rise? If review minutes drop slowly, fully loaded cost per resolution has a hard floor that better models will not break.
- Can outcome-based pricing survive heavy-tailed task cost? Vendors absorbing failure and retry cost need exclusions or tail pricing, and how contracts handle this is largely undisclosed.
- Do benchmark token counts predict production token counts? Nearly all public cost-per-task figures come from benchmark harnesses, so their transfer to real workflows is untested.
Sources
- runcost-ai - RunCost — PyPI
- How Do AI Agents Spend Your Money? Analyzing and Predicting Token Consumption in Agentic Coding Tasks - License: CC BY 4.0 — arXiv
- What Does It Really Cost to Run an AI Agent in Production? A Framework for Agent ROI — Open Data Science Conference
- How Do AI Agents Spend Your Money? Analyzing and Predicting Token Consumption in Agentic Coding Tasks - To understand how token efficiency differs across models, we first analyze the trade-off between task accuracy and token consump... — arXiv
- OpenAI Codex vs Claude Code: The Better AI Coding Agent Depends on More Than Benchmarks - TechRepublic - OpenAI Codex vs Claude Code: The Better AI Coding Agent Depends on More Than Benchmarks — TechRepublic