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.

Run a free scan

Mistakes that cost the most

MistakeWhy it hurtsDo 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

  1. Count calls and runs for one agent feature last week. The ratio is the multiplier you've been ignoring.
  2. Take your most expensive single run and list its calls in order. The shape will surprise the person who built it.
  3. Check whether a sub-agent call carries the parent run identifier. If it doesn't, that spend is unattributable.
  4. Compare your cheapest and dearest run of the same feature. Variance that wide is a product question, not a cost one.
  5. 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.

Planner call: (4 x $0.005) + (0.8 x $0.025) = $0.020 + $0.020 = $0.040
Six tool steps, average 12k in and 400 out: 6 x [(12 x $0.005) + (0.4 x $0.025)] = 6 x $0.070 = $0.420
Two sub-agents, five calls each at 9k in and 600 out: 10 x [(9 x $0.005) + (0.6 x $0.025)] = 10 x $0.060 = $0.600
Synthesis pass: (20 x $0.005) + (1.2 x $0.025) = $0.100 + $0.030 = $0.130
Run total = $0.040 + $0.420 + $0.600 + $0.130 = $1.19 across 18 calls

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

FigureWhat it meansConfidenceSource
$1.19modelled cost of one complete agent run across 18 calls on Claude Opus 4.8calculatedSum 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 callcalculated$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.

1

Change one base URL.

Or drop in the Python or TypeScript library.

2

Find your most expensive conversation.

In the first session, not the first week.

3

Cost your next feature before you ship it.

Base URLhttp://localhost:4545/v1Your traffic keeps flowing if Culpa ever stops.

Why the bill went up

Example dashboard

Calls 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

$0$20$40$60$8024262830020406
user_384report_generatorconv_91fprompt_v1894,220 tokens3 retries$6.81

Most expensive users

user_384$38.42
user_119$21.07
user_562$14.90
user_204$8.30
user_871$5.10

Next week forecast

Best$180
Median$240
p90$310
p99$395

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.

Run a free scan

Keep reading


Sources: Anthropic pricing. Last reviewed 2026-08-01. Plain text version.