Cost Per Successful LLM Task: How Much Did You Spend for Success?
Your LLM invoices show API line items. What was spent on Claude, OpenAI, Gemini last month? You look at the $700 total and ask yourself: What did I get for that spend?
This is the right question to ask. The problem: The invoice cannot answer it.
Your bill tells you how much you paid. It does not tell you how many of your attempts succeeded, and what they cost. In the world of LLM token costs, seeing the total spend is like picking up a restaurant receipt from the sidewalk and trying to judge whether a meal you never ate was worth it. You see the number. You do not know whether the food was good.
What Is Hiding in the Bill
Let's say, 28% of your LLM-aided tasks succeed. But, 72% failed. You're charged for both.
Failed tasks don't produce financially or economically valuable work. They consume tokens, retry budgets, and context windows, then vanish from the outcome column.
You are paying for effort, not results.
The default way people measure LLM spending is cost per token. You look at your invoice and divide total spend by total tokens consumed. This is a clean number. It is also very incomplete.
When a task fails, the tokens are still burned. If context bloats with stale files across 20 turns, every token in the LLM's context is billed. All of this shows up on your invoice as valid API calls. None of it tells you whether the work actually succeeded.
Measuring the Cost of Success
But what if you had a different metric? Rather than simply looking at what you spent, what about measuring the cost of success, or Cost Per Successful Task (CPST)?
CPST has emerged in 2026 as a leading way to measure the true economic value of agentic AI. Other teams have built frameworks around it:
- Digital Applied defines it for procurement scoring
- Gloss.run ties it to agent loop convergence
- CodeBridge folds it into enterprise cost buckets
- OptyxStack treats it as a production telemetry primitive.
All of them share the same perspective: cost per token is the wrong metric. Instead, we need to look at what percentage of tokens are spent on verifiably productive and economically beneficial work.
Where most approaches stop is at the cost accounting layer. How much you did pay per successful tas?.
This research was designed to take the next step by measuring the behavioral factors that drive CPST via a using a 234,751-user simulation grounded in research published by Anthropic in June 2026.
The CPST formula:
CPST = Monthly API Spend / Total Tasks × Success Rate
- Monthly API Spend: Llm cost per token over time
- Total Tasks: How many attempts were made
- Success Rate: The percentage of verified successful tasks completed with LLM assistance during a session. This can include commits pushed to GitHub, reports generated, or financial analyses delivered. Verified means you are sure the work produced a valuable outcome.
This single number tells you what each successful task actually costs. The deeper question, and the focus of what follows, is which behavioral levers move that number the most.
The answer is not simply model selection. It is retries, cache behavior, context hygiene, and prompt overhead.
What Do You Get From Measuring CPST
Measuring AI agent ROI with CPST provides four practical benefits:
Connect spend to return. Measuring the ROI of LLM spend becomes easier. You are able to identify which models (and users) are getting the most out of every LLM session.
Find process inefficiencies. You identify the behavioral patterns that inflate your bill, such as redundant retries and bloated context.
Benchmark across workflows. You compare apples to apples. A workflow that looks expensive may have a lower CPST than a "cheaper" one that fails half the time.
Set outcome-based targets. You, your team and organization can optimize for financially and economically valuable work. CPST targets can be set. Priority setting becomes simpler. Workflows with high CPST costs deserve serious examination. Those with low CPST costs should be replicated.
How CPST Was Calculated in the Simulation
This simulation grounds CPST calculations in verified success metrics Anthropic identified in its June 2026 research: "Agentic coding returns to expertise." This is defined as "At least one HARD verifiable success signal: a git commit whose message matches the work, a PR opened or merged, a test suite passing on the change, a command running to completion..."
Anthropic found that LLM-aided task success ranged from about 15% for novices to 33% for users with expert-level domain knowledge. This was the baseline used to calculate task success rates in the simulation.