Cost Per Successful Task Leaves Out the Expensive Part

Cost per successful task for two models: B is cheaper when failures are retried, A is cheaper when a person fixes them

In my last post I told you to put cost per successful task in your model switch rule. I gave you the formula most people use: what a run costs, divided by how often it works. I’d bet that formula is pointing some teams at the wrong model, because it prices a failure at the cost of one more run.

I see this most on code-generation agents. I don’t have one clean story I can share from work, so I’ll give you the pattern instead. Take an agent that builds small business apps. Two of its steps look alike on a cost dashboard. In the first, it writes the code for a form, and if the code is wrong, the build fails within seconds and the agent tries again. In the second, it maps fields from the customer’s data model into the app: which column holds the order date and which holds the delivery date. If it picks the wrong column, the app builds and the tests pass. A developer finds the mistake in a demo a week later, or a customer finds it in production. The formula prices both failures as one more run.

Three definitions of cost per successful task

Three companies published this formula before I did, and they agree on the division. Arize, which sells tools for tracing and evaluating AI agents, defines cost per successful task as “the cost of running a model on a task divided by the rate at which the model completes that task correctly.” LangWatch, an agent-testing vendor, uses the same division and calls it “the only cost metric that matters for agentic workloads”. A third write-up, from Digital Applied, calls it CPST: input, output, tool, retry and cache costs, divided by the number of runs that pass.

The idea is older than this year’s write-ups. In 2024, Sayash Kapoor, Arvind Narayanan and colleagues at Princeton argued that agents should be judged on cost and accuracy together, and found that the top agents of the day were “needlessly complex and costly”.

Why it beats price per token

It’s a good formula, and it replaces a worse one. In Digital Applied’s words, price per token “dominated AI procurement for two years”, and the best-known trackers still count in tokens. Andreessen Horowitz tracks the cost of a fixed level of capability falling about 10x a year. Ramp, the corporate-card company, publishes an AI index from what US businesses spend, and it has the price they pay per million tokens down about 41% since March, from $1.15 to $0.68.

Those prices fall while the bill for each task climbs, because agents burn through far more tokens than chat does. A study co-written by Stanford economist Erik Brynjolfsson tested eight frontier models on coding tasks, and found that agentic coding uses about 1,000 times the tokens of code chat or code reasoning. Gartner forecasts that inference cost per agentic workflow will rise more than fivefold through 2028, and its analyst Will Sommer told product leaders that they “cannot rely on more efficient token economics to rationalize AI costs.”

The per-task view catches what a rate card hides. Arize’s example comes from AA-Briefcase, a set of 91 long knowledge-work tasks that Artificial Analysis uses to benchmark models. When Arize wrote it up in July, Claude Fable 5 led the benchmark, at about $31 a task, and got the whole task right 3% of the time. Divide one by the other and each fully correct result costs about $1,000. No price per token would show you that, and one eval run gives you both inputs.

So the division beats price per token. It also has a condition built in: it’s right when a failed run costs you nothing beyond the next run.

The formula assumes a failure costs one more run

Plenty of failures cost more than that. Dividing by the success rate gives you what you’d pay if you kept running the task until it worked. That only happens when something tells the agent it failed, like a failing test or a broken build. When nothing does, the failure goes to a person, and you pay for their time.

LangWatch saw this and left it out of the sum. Its worked example has a model at $0.80 a run that succeeds 78% of the time, which comes to $1.03 per successful task. A cheaper model at $0.20 a run that succeeds 15% of the time comes to $1.33, “plus every failure a human has to catch.” The human is in the sentence and missing from the number.

Put a price on that human and the choice can flip. Take two hypothetical models. Model A costs $0.40 a run and succeeds 92% of the time. Model B costs $0.08 a run and succeeds 78% of the time. With the retry formula, B costs $0.08 ÷ 0.78, about $0.10 per successful task, and A costs $0.40 ÷ 0.92, about $0.43. B wins at less than a quarter of the price. Now say failures aren’t retried: a person finds each one and fixes it, and the fix takes $6 of their time. The expected cost of a task is the run cost plus the failure rate times the cost of a failure. A comes to $0.40 + (8% × $6) = $0.88. B comes to $0.08 + (22% × $6) = $1.40. The cheap model now costs 59% more per task.

Those two pairs of numbers answer different questions. The first pair assumes a check catches each failure and the agent tries again. The second assumes a person catches it. The app-building agent produces both kinds, sometimes in the same run, which is why you have to look at each task type on its own.

Of the write-ups I found, only Zartis, a software firm, puts the person in the formula. It adds the failure rate times the human cost of fixing each failure. I’d take it one step further and work the number out per task type, because the cost of a failure changes from one task to the next. Harvey, which builds AI for law firms, found in 2025 that Gemini 2.5 Pro “excels at legal drafting but struggles at trial preparation and oral argument”. A weak draft costs a lawyer some edits. A mistake in trial preparation can surface in front of a judge. The same model can be the cheap choice for one task and the expensive one for the next.

Within one task type, the average still hides the expensive runs. The coding-agent study I cited above also found that runs on the same task can differ by up to 30x in total tokens. So track the p95 cost per task next to the median, because your budget has to cover those runs too.

Price the failure, then pick the model

So start each model decision with one question per task type: when this task fails, who finds out? If a test or a build catches it, the retry formula works, and the cheapest model that passes is the right one. If a person or a customer catches it, price their time.

That price gives you a break-even. Take the difference in run cost between two models and divide it by the difference in their failure rates. In the example, A costs $0.32 more per run and fails 14 points less often, so the break-even is $0.32 ÷ 0.14, about $2.29. If a failure costs less than $2.29, run model B. If it costs more, run model A. A rough estimate of the failure cost is enough, as long as you can tell which side of $2.29 it falls on.

You’re the person on the team who can make that estimate. Engineering sees the run cost and the pass rate. The cost of a miss sits with the people who clean it up: the support team’s handling time on an escalated ticket, the credit you give a customer, the hour a developer spends fixing a generated app. A PM can ask each of them for a range.

Go back to the app-building agent. The form step gets the small model, because a build catches its failures and the retry formula holds. The field-mapping step is where the formula misleads you. Say a wrong mapping costs an hour of a developer’s time once someone notices it. Use the prices from the example, where model A costs five times as much per run as model B. The break-even is about $2.29, and an hour of any developer’s time is far above it, so the larger model wins on that step. It’s the same kind of schema-mapping case that my last post’s switch rule made non-negotiable.

Once you have the failure cost, two more decisions follow from it. The first is how much eval work to pay for. A one-point gain in success rate is worth your monthly task volume × 1% × the failure cost. At a hypothetical 50,000 tasks a month and $6 a failure, each point is worth $3,000 a month. Evals cost money too: Princeton’s Holistic Agent Leaderboard, which compares agents across nine benchmarks, spent about $40,000 on 21,730 agent runs. You don’t need that scale to start. Anthropic’s guide to agent evals suggests “20-50 simple tasks drawn from real failures” as a first set.

The second is the bar a model has to clear before it ships. When failures are expensive, run each test case several times and require it to pass each time. The same Anthropic guide shows why: a model that succeeds 75% of the time on one try passes three tries in a row about 42% of the time. On τ-bench, a customer-service benchmark from Sierra, GPT-4o handled all eight repeats of the same retail task about a quarter of the time.

None of this means the dearer model is the safer one. Princeton’s leaderboard also found that raising the reasoning effort reduced accuracy in most of its runs. Sierra builds its customer-service agents from “15+ frontier, open-weight, and proprietary models, depending on the job to be done”, and picks them with task-specific evals. You measure the larger model on the expensive task before you pay for it.

If you charge per outcome, the failure cost also sets your margin. When you price per resolution, you keep the price minus the expected cost per task. The investment firm ICONIQ surveyed more than 300 executives and put AI product gross margin at 45% in 2025, with 53% projected for 2026. A failure cost you never counted comes out of that margin.

When the retry formula is the right one

Still, the published formula is the right one for a lot of work. A coding agent with a test suite in a sandbox fails, sees the failing test and tries again. The form step in the app-building agent works the same way: the build breaks within seconds, and the agent has another go. Failures like these cost one run each, and run cost ÷ success rate is the whole answer.

Long, expensive runs are the second case. When one run costs $31, as Fable 5’s did on AA-Briefcase, the $6 cleanup from my example is small next to the price of running the task again, and the success rate decides which model wins.

Low volume is the third case. I haven’t found published data on the task volume below which this analysis costs more than it saves. At a few hundred tasks a month, a rough failure-cost range on a whiteboard may be all the work it deserves.

So check one condition on your own agent. If code catches each failure before a person sees it, keep dividing by the success rate. If people catch some of them, the formula leaves out what those people cost.

One number to find this week

Pick your highest-volume task type. Write down what a run costs, how often it succeeds, and what one failure costs the person who has to fix it. You’ll have the first two from your last eval run.

Who on your team knows the third?

Share via
Copy link