Guides / cost per agent
What is cost per agent?
Cost per agent is the total model spend for one complete autonomous run, counting every sub-call, tool step and retry the agent made before it answered. One run isn't one call, it's a tree. Culpa, a local-first LLM cost, margin, and forecast ledger, traces each call back to the run that spawned it and prices the whole tree as a single unit.
Why this happens
An agent presents one interface and generates many calls behind it. The developer sees the first prompt and the final answer, so that's the shape they carry in their head when they estimate cost. What actually happened was a planner call, a dozen tool-using steps that each resent the growing transcript, two sub-agents with their own call trees, and a synthesis pass over everything. Pricing the run means collecting all of it under one identifier, and that identifier has to be created at the top and passed down.
What this usually looks like
- Your call count is many times your run count and nobody has stated the ratio out loud.
- Cost estimates for a feature were built from the prompt a developer wrote, not from the calls it produced.
- Sub-agent calls appear in the bill with no link back to the run that triggered them.
- Two runs of the same feature differ in cost by an order of magnitude depending on how long the agent worked.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Mistakes that cost the most
| Mistake | Why it hurts | Do instead |
|---|---|---|
| Pricing an agent feature from its opening prompt. | The opening prompt is the cheapest call in the tree and usually a tiny fraction of the run. | Price a full run end to end, then multiply by run volume. Never extrapolate from a single call. |
| Letting sub-agents create their own trace identifiers. | The sub-tree becomes an orphan, so its spend lands in the bill with nothing to attribute it to. | Pass the parent run identifier into every sub-agent and tool call, so the whole tree rolls up. |
| Capping agents on wall-clock time rather than on spend. | A fast model can burn more in sixty seconds than a slow one does in ten minutes, so time bounds nothing. | Cap the run on accumulated cost, and stop when it crosses the ceiling regardless of how long it took. |
Run this check tonight
- Count calls and runs for one agent feature last week. The ratio is the multiplier you've been ignoring.
- Take your most expensive single run and list its calls in order. The shape will surprise the person who built it.
- Check whether a sub-agent call carries the parent run identifier. If it doesn't, that spend is unattributable.
- Compare your cheapest and dearest run of the same feature. Variance that wide is a product question, not a cost one.
- Confirm a run has a spend ceiling that stops it, rather than a step limit that a long step can blow through.
One research run, eighteen calls, one bill
Illustrative example
A research agent on Claude Opus 4.8 at real rates of $0.005 per 1k input and $0.025 per 1k output. The call tree and token volumes below are modelled on a typical tool-using run.
The planner call a developer watches in the logs is $0.040 of a $1.19 run, about 3%. Anyone estimating this feature from the prompt they wrote was out by a factor of thirty.
Every number, with its confidence and source
| Figure | What it means | Confidence | Source |
|---|---|---|---|
| $1.19 | modelled cost of one complete agent run across 18 calls on Claude Opus 4.8 | calculated | Sum of the teardown arithmetic at real Claude Opus 4.8 rates per 1k tokens from the price book, effective 2026-07-02. The call tree and token volumes are modelled. |
| 3% | share of a modelled run's total cost carried by the opening planner call | calculated | $0.040 divided by $1.19, from the teardown arithmetic. |
What a generic answer can’t know
A provider sees eighteen unrelated calls. The fact that they were one run, triggered by one user, for one customer, exists only in your application's own control flow. Grouping them needs a run identifier created at the top and passed down through every tool and sub-agent. Culpa keeps that on your infrastructure, where your prompts and responses stay, and counts the calls to run your plan.
Questions founders ask next
How is cost per agent different from cost per call?
A call is one request to a model. An agent run is every call the agent made to finish the job, including tool steps, sub-agents and retries. Reasoning about agents at the call level gives you a number that's correct and unusable.
How do I stop an agent run getting expensive?
Cap it on accumulated spend rather than on step count or elapsed time. Steps vary in cost by more than an order of magnitude across a run, so a step limit bounds the wrong quantity and time bounds nothing at all.
Do failed tool calls count in cost per agent?
Yes. A tool step that errored still sent a prompt and still billed for whatever the model generated before the failure. Excluding it understates the run by exactly your failure rate, and failures cluster in the hardest runs.
On your infrastructure
Culpa runs on your infrastructure. Your prompts and responses never leave it. Culpa counts calls to run your plan, and it fails open, so if it ever breaks your app keeps running.
How Culpa works
Find the culprit. Not just the total.
Your dashboard shows what you spent. It stops short of who spent it. Culpa shows the conversation, the user and the feature behind it.
Your prompts stay local.
Culpa runs on your own infrastructure. What you send to a model reaches us at no point.
Every dollar has a name.
Follow any charge to the conversation, the user, the feature and the customer behind it.
See the bill before it lands.
Cost your next feature before you ship it. You get the likely bill and the worst case, at best, median, p90 and p99.
Three steps to your first answer.
Change one base URL.
Or drop in the Python or TypeScript library.
Find your most expensive conversation.
In the first session, not the first week.
Cost your next feature before you ship it.
Why the bill went up
Example dashboardCalls traced
418,209
across 3 projects
Spend this week
$378.41
+ $182 vs last week
Failed calls
312
74% retried, and you paid for all of them
+ $182 this week traced to one culprit
Spend over 14 days
Most expensive users
Next week forecast
Graded against reality. Accuracy shown as results land.
Free, no card, no account
Run the free Cost Leak Scan
It shows your most expensive conversation before you install anything.
Keep reading
Sources: Anthropic pricing. Last reviewed 2026-08-01. Plain text version.