AI agent cost is the total expense of operating an AI agent, including model usage, tool execution, infrastructure and retries. Unlike the cost of a single model request, it depends on how many steps the agent takes, how much context each step consumes and which external resources it uses.
Ask how much an AI agent costs and most answers are about building one: development time, integration work, a project budget. This entry is about the other number, the one that arrives every month: what it costs to run an agent, task after task. That number is harder to predict, because an agent decides for itself how much work each task takes.
What drives operating cost
An agent’s running cost is the sum of several parts, and the model’s price per token is only one of them.
- Steps. Each step is at least one model request. A task that takes 40 steps costs more than one that takes 10, even on the same model.
- Context per step. Every request re-sends the agent’s accumulated context, so later steps cost more than early ones. This is context cost, and caching changes its price a great deal.
- Output. Generated tokens usually cost several times more per token than input, though agents generate far less than they read.
- Retries and failed runs. A failed tool call, a step the agent redoes, or a whole run that has to start again. Each retry re-sends the context accumulated up to that point.
- Tools and external services. Search APIs, paid data sources, other models the agent calls.
- Infrastructure. Sandboxes, compute for running code, storage, logging.
- Human time. Reviews and approvals cost people’s attention, which rarely appears on an invoice and is often the most expensive part.
A worked run
The run below is illustrative. Model prices are Anthropic’s published standard rates for Claude Sonnet 5.5 as of October 2026. Tool and infrastructure prices are assumptions, chosen to show the shape of the calculation, not to describe any particular service.
Assumptions: a 20-step task with caching working throughout (the same run as in the context cost entry), eight calls to a search API at an assumed $0.005 each, and ten minutes of sandbox time at an assumed $0.10 per hour.
| Component | Cost per run |
|---|---|
| Model usage, with caching | $0.2112 |
| Search API (assumed) | $0.0400 |
| Sandbox time (assumed) | $0.0167 |
| Per run | $0.2679 |
Now suppose one run in five fails and has to be repeated. A hundred tasks then take 120 runs:
- 120 runs at $0.2679 cost $32.14;
- divided over 100 successful tasks, that is $0.32 per successful task, about 20 percent more than the cost of one run.
Add people. If someone spends two minutes checking each of the 20 failures, at an assumed loaded cost of $60 an hour, those 40 minutes cost $40, more than the $25 of model usage across all 120 runs.
| For 100 successful tasks | Total | Per successful task |
|---|---|---|
| Automated cost: model, tools and sandbox over 120 runs | $32.14 | $0.32 |
| Human review (assumed) | $40.00 | $0.40 |
| All-in cost | $72.14 | $0.72 |
The automated figure, about $0.32, is what usage and infrastructure bills show. The all-in figure, about $0.72, is what each successful task actually costs once review time is counted, and more than half of it never appears on an invoice.
Cost per successful task
The honest unit for agent cost is cost per successful task, not cost per request or cost per run. It counts the failures, retries and reviews that a per-request figure hides, and it is the number that decides whether an agent is worth running.
It is also a distribution, not a single number. A 2026 study of agents on coding tasks found that agentic tasks consumed around 1,000 times more tokens than code reasoning or chat, that input tokens rather than output tokens dominated the cost even with caching, and that runs of the same task could differ by up to 30 times in total tokens, without higher token use bringing higher accuracy. In our own experiment on context compaction, total input across whole runs of the same design ranged from under 59,000 to over 116,000 tokens, because the path the agent took (how many requests, how many repeated lookups) outweighed the savings at any single step.
So a budget for an agent is better set on the range than on the average.
Controlling cost is a governance question
The levers that control agent cost are mostly limits on behavior:
- Budgets per task, in tokens or money, with a defined response when one is reached.
- Step and retry limits, so a looping agent stops instead of compounding.
- Cache discipline: keeping instructions and tool definitions stable, and dynamic details out of the prompt prefix.
- Choosing the model per step, where a smaller model is enough.
- Spending human attention where it matters, rather than on approving routine steps.
These are the same decisions as deciding what an agent is allowed to do, applied to resources. That is why the efficiency of an agent, what successful completion cost, belongs alongside compliance and completion as part of AI agent governance.
How Sentience Governor relates
Sentience Governor records token usage in the Sentience Agent Execution Record, broken into cache reads, cache writes, uncached input and output, and attributes it to the turns where the activity happened, including turns with findings against the declared task. It reports tokens, not money, and it does not know whether a run succeeded, so cost per successful task combines its record with pricing and outcome data from elsewhere.
Often confused with
Context cost. One component of model usage: the price of re-supplying accumulated context. Agent cost is the whole.
Model price. The price per million tokens is an input to agent cost, not a measure of it. Two agents on the same model can differ in cost per task by an order of magnitude.
Build cost. What it costs to develop an agent. A separate number, paid once, that says little about what each task will cost.
Where the concept stops
AI agent cost measures what running an agent consumes. It does not say whether the spending was worthwhile, which requires knowing whether tasks succeeded and what they were worth. And estimates of it are only as good as their assumptions, which is why any cost model for agents should state them.