Token cost is the smallest honest line on an agent's bill. Price from it and the retries, reviewers and hosting you forgot will come out of your margin.
- A worked support agent costs about 93 cents per run fully loaded, against a single-call estimate more than twenty times lower.
- Retries compound: an 18% failure rate means 1.22 attempts per run, and a 40% rate means 1.67 attempts, not 1.4.
- Human review at a 10% escalation rate adds 30 cents per run, about three times what tools, evals and hosting cost combined.
- Divide by the share of runs that finish a task the customer accepts: at 70%, 93 cents becomes $1.33 per outcome, above Intercom's 99 cent price per resolution.
- Caching a static 8,000-token prompt prefix saves about 16 cents per run, and a hard step cap trims the runaway loops that distort your average.
Take a support agent that looks cheap on the invoice: 10,000 tokens in, 1,000 out, about 4.5 cents a call. That's the number most teams carry into the pricing meeting. If you want to know how to calculate cost per AI agent run, start by distrusting it, because in the worked example below the fully loaded figure lands at more than twenty times that.
Every input here is an assumption we picked to be realistic, not a measurement from a named company, so swap in your own logs. The method is what travels, and it works for any agent that loops, calls tools and sometimes needs a person.
A single prompt isn't an agent run. The agent calls the model, reads a tool result, calls the model again with everything so far attached, and keeps going until it's done. Each pass re-sends the growing context, so input tokens climb faster than the step count does.
In our example a run takes six model calls. The context starts at 10,000 tokens and picks up about 4,000 more from each tool result, so the calls send 10,000, 14,000, 18,000, 22,000, 26,000 and 30,000 tokens. That's 120,000 input tokens before the agent says a word to the customer. Add roughly 800 output tokens per call, 4,800 in all. At an illustrative $3 per million input tokens and $15 per million output, the model bill is $0.36 plus $0.072, or about 43 cents.
How to Calculate AI Agent Cost Per Task Before It Wrecks Your Margin Anthropic's Claude Opus 4.5 pricing runs $5 per million input tokens and $25 per million output, and retries on failed runs can cost more than the original attempt, turning a 70% success rate into roughly triple the cost of a 95% rate. - how to calculate AI agent cost per task - AI agent pricing model for startup margins
Nearly ten times the napkin figure, and we haven't left the model line yet.
The measurement fix is boring, which is why teams skip it. Tag every model call with a run ID and sum by run, not by request. Most provider dashboards show tokens by day or by key, so the spreadsheet ends up with a per-call number that has nothing to do with what a customer task actually consumes.
Cost per agent task including retries #
Retries come in three kinds. The provider times out and you resend. The output fails schema validation and you reprompt. Or the whole run fails a check and starts over. Most teams count the first kind, if any, and ignore the other two, even though a full restart pays for every token and every tool call a second time.
The formula is short. If a fraction p of attempts fail and you rerun in full, expected attempts per run are 1 divided by (1 minus p). At an 18% failure rate that's 1.22 attempts, which lifts our 43 cents to about 53 cents. Fine so far.
The trap is the curve. People hear 40% failures and add 40% to the bill. The real multiplier is 1.67, because a rerun can fail too. At 50% it's exactly double. A failure rate you'd call tolerable in a demo turns into a pricing problem somewhere between 25% and 40%, and you won't see it coming if you track retries as a footnote.
Measure the rate on real traffic and per failure type. A schema error that reprompts only the last step costs a fraction of a full restart, so your actual multiplier may sit below the formula. It rarely sits at 1.0.
The infrastructure cost per run: tools, retrieval and the fixed bill #
Tool calls often carry their own fee on top of tokens. Anthropic's published pricing for its web search tool, for one, charges $10 per 1,000 searches, a cent each, before a single token of the results is billed. Check the current price sheet for whatever you use, because these change.
[How to Price AI Agent Seats With Variable Usage That Actually Holds](https://startupfortune.com/how-to-price-ai-agent-seats-with-variable-usage-that-actually-holds/)
The $40-a-seat coding agent example shows why: one developer costs $2 in inference, another running fifteen pull requests a day costs $100 or more on the identical seat. Intercom charges per resolution instead, while OpenAI and Anthropic bundle a seat with a metered usage pool. - [how to price AI agent seats fairly](https://startupfortune.com/how-to-price-ai-agent-seats-with-variable-usage-that-actually-holds/) - [variable usage pricing for AI agent software](https://startupfortune.com/how-to-price-ai-agent-seats-with-variable-usage-that-actually-holds/)
In our example the agent makes four paid tool calls at half a cent each and three vector lookups at 0.2 cents each. That's 2.6 cents per attempt, and 3.2 cents per run once the retry multiplier is applied, since the failed attempt paid for its searches too. It's small. Don't conclude it's always small: an agent that calls a data-enrichment or scraping API per step can spend more on tools than on the model.
Then comes the part nobody attaches to a run. Observability, log storage, the vector database, queues and the evaluation dashboard are monthly bills. Say they total $1,800. Spread over 40,000 runs a month, that's 4.5 cents a run. Spread over the 4,000 runs you'll actually do in your first quarter, it's 45 cents.
Use forecast volume, then test the price at one-tenth of it. A fixed cost that looks like rounding at scale can double your cost per run on launch day.
Evals and human review, the lines founders skip #
If you score runs with a model acting as judge, you're paying for a second model call that carries the whole transcript plus a rubric. Suppose it costs 12 cents per scored run and you sample 20% of traffic. That's 2.4 cents added to every run on average. Regression suites you rerun on each prompt change belong in the same bucket, charged monthly and spread across volume like hosting. Human review is where our example turns. Assume 10% of runs escalate to a person, who spends five minutes at a loaded cost of $36 an hour. Each review costs $3.00, and the average run carries 30 cents of it. That's roughly three times the tools, evals and hosting lines put together. Each point of escalation rate is worth 3 cents per run, which makes the escalation rate one of the most expensive dials in the whole model.
Frankly, this is the line that most often goes missing, because the reviewer's salary sits in a different budget from the cloud bill. Put it in the same spreadsheet. If a human touches 1 run in 10, the human is part of the product, and the product has to pay for them.
The full run in one place #
Add it up. The model line, with retries, is 52.7 cents. Tools and retrieval are 3.2 cents, evals 2.4 cents, human review 30 cents, and the fixed bill 4.5 cents. The total is about 93 cents per run, against 4.5 cents on the napkin.
The model bill is still the biggest piece, at 57% of the total, which is why nobody questions it. But a third of the cost is a person, and about a tenth is retries. Neither appears in the usage dashboard where most teams read their costs.
Now the number that matters for AI agent unit economics. Not every run ends in something a customer would pay for. If 70% finish a task the customer accepts, you divide 93 cents by 0.70 and get $1.33 per successful outcome. That's the cost you're really pricing.
Check it against the market. Intercom charges $0.99 per resolution for its Fin support agent, a price it has held since launch. Under our assumptions, a company with this cost structure would lose about 34 cents on every resolution it sold at that price, before salaries, sales or support. Fin's own costs will differ, and Intercom hasn't published them. The exercise shows how little room a 99 cent price leaves if your agent loops six times and one run in ten reaches a human.
Salesforce took a different route. It launched Agentforce at $2 per conversation and has since added a per-action option at 10 cents, according to its own pricing announcements. Vendors that sell at scale are experimenting with the unit because a conversation hides how much work sits inside it.
The margin math is simple. Price equals cost divided by one minus your target margin. At 70% gross margin, $1.33 becomes a price of $4.42 per resolved task. Run the same formula on the napkin number and you'd have quoted 15 cents, then spent the first year wondering where the money went.
Three cuts that move the number #
Caching comes first. Anthropic lists cached reads at a tenth of the base input price. If 8,000 tokens of each call are a static prefix, such as instructions and tool definitions, then 48,000 of our 120,000 input tokens drop from $3 to $0.30 per million. That saves about 13 cents per attempt, or 16 cents per run after retries. It ignores the one-time premium for writing the cache, so treat it as a ceiling.
Second, cap the loop. Our typical run makes six calls. A run that wanders to twenty calls sends about 960,000 input tokens and costs roughly $3.12, over seven times the typical run. If one run in 50 does that, it adds 5 cents to the average and hides in the tail where nobody looks. Set a maximum on steps and on dollars per run, and make the agent hand off to a person when it hits either.
Third, work the escalation rate. Cutting it from 10% to 7% saves 9 cents per run, more than most teams will find by shaving prompts. That means better tool design, clearer refusal rules and fewer cases where the agent hands off because it couldn't find an answer that existed.
Do all three and our 93 cent run drops to roughly 60 cents. It doesn't reach the napkin number, and it won't.
Start with the one figure you can pull today: total tokens per run ID, not per request. If it's more than three times what your pricing sheet assumed, you already know which way the rest of the ledger will go.
Also read: Your gross margin payback period for startups can be double what you report • How to set an AI agent tool call timeout before one slow API stalls a run • How to Build a Golden Dataset for AI Agent Evaluation From Your Logs
This article is posted in AI News, check it out for more related stories.
Join the discussion #
Open in the community → Almost there. Sign in and your reply posts straight away.