An AI agent has two costs: a one-off build cost, driven by how many systems it connects to, how much testing it needs and how many safety checks surround it, and a running cost per task, which is the tokens it consumes on every loop plus tool fees, hosting and the time people spend reviewing its work. On October 2026 list prices, the model usage for the six-step agent task worked through below comes to between under a cent and about 80 cents, depending almost entirely on which model you pick and whether you cache. The build is where the real money goes, and it is priced by scope, not by a menu.
What makes up the cost of an AI agent?
A build line, paid once and again whenever you widen the scope, and a run line, paid on every task.
| Cost line | What drives it | One-off or recurring |
|---|---|---|
| Scoping | Number of case types, number of people who must agree on "done" | One-off |
| Integrations | Number of systems the agent reads from and writes to, and the quality of their APIs | One-off, plus upkeep when those systems change |
| Evaluation set | How many real past cases you collect and grade before launch | One-off, grows over time |
| Guardrails and approvals | How many actions are risky enough to need a check or a human sign-off | One-off |
| Model usage | Tokens per task × tasks per month × price per token | Recurring |
| Tool fees | Paid tools such as web search, file search or code containers | Recurring |
| Hosting and monitoring | Where the loop runs, logs, alerts | Recurring |
| Human review | Escalated cases × minutes per case × staff cost | Recurring |
Most published price ranges for "an AI agent" skip the bottom half of this table, which is the half you pay every month.
How much does it cost to build an AI agent?
It depends on four drivers, and each one can be sized before anyone writes code.
Integrations. An agent is only as useful as the tools it can call. OpenAI's guide to agents defines one as a model, tools and instructions, and the tools are where engineering time goes. Anthropic says that while building its own coding agent it "spent more time optimizing our tools than the overall prompt." A read-only connection to one well documented system is a small job. Write access to an old ERP with no clean API is not.
Evaluation. Before an agent goes live you need a set of real cases with known correct outcomes, so you can tell whether a change made it better or worse. Anthropic's testing guidance recommends evals that mirror your real-world task distribution, edge cases included. Grading them takes time from the people who do the job today.
Guardrails and approvals. OpenAI recommends rating every tool low, medium or high based on factors like read-only vs. write access, reversibility, required account permissions, and financial impact, and pausing or escalating to a human before high-risk calls. Each approval step needs a screen, a queue and a log. An agent that only drafts is cheaper to build than one that sends, pays or deletes.
Autonomy. The more steps the agent decides for itself, the more testing it needs. Anthropic warns that the autonomous nature of agents "means higher costs, and the potential for compounding errors" and recommends extensive testing in sandboxed environments. If a fixed workflow with one model step can do the job, it will be cheaper to build and to run. Our guide on how to build an AI agent walks through those steps in order.
There is no dollar range here on purpose: the spread between "reads one inbox" and "acts in five systems" is larger than any range can hold.
How much does it cost to run an AI agent per task?
monthly model cost = (input tokens per task × input price + output tokens per task × output price) × tasks per month
The catch is the input side. An agent works in a loop: the model calls a tool, the tool result is added to the conversation, and the whole conversation goes back to the model for the next step. OpenAI states that even with server-side conversation state, all previous input tokens for responses in the chain are billed as input tokens. So step six of a task pays again for steps one to five. Our explainer on input vs output tokens covers why input usually dominates.
That loop is why agents cost more than chat. In Anthropic's own data, "agents typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats."
What does an agent cost on October 2026 prices?
Here is a worked example you can recompute. Take an agent that handles one support case that needs a few lookups:
- 5,000 tokens of instructions and tool definitions, plus a 500 token case description, so the first call sends 5,500 tokens.
- Six model calls per task. Each call writes 400 output tokens (its reasoning and a tool call).
- Each of the first five calls triggers a tool whose result adds 2,000 tokens to the context.
Every call resends everything before it, so each call is 2,400 tokens larger than the last (400 output plus 2,000 tool result). The six calls send 5,500, 7,900, 10,300, 12,700, 15,100 and 17,500 input tokens: 69,000 input tokens in total. Output is 6 × 400 = 2,400 output tokens.
Now price it. All rates are per million tokens, as of October 2026, from the Anthropic pricing page and the OpenAI pricing page:
| Model | Input / output price | Input cost | Output cost | Per task | 2,000 tasks a month |
|---|---|---|---|---|---|
| Claude Haiku 5.5 or GPT-6 Luna | $0.10 / $0.50 | $0.0069 | $0.0012 | $0.0081 | $16.20 |
| Claude Sonnet 5.5 or GPT-6.1 Sol | $2 / $10 | $0.138 | $0.024 | $0.162 | $324 |
| Claude Opus 5.5 | $4 / $20 | $0.276 | $0.048 | $0.324 | $648 |
| GPT-6 Astra | $10 / $50 | $0.69 | $0.12 | $0.81 | $1,620 |
Each row is 69,000 × input price ÷ 1,000,000 plus 2,400 × output price ÷ 1,000,000. Two footnotes matter. Anthropic's Haiku 5.5 price applies for prompts up to 100,000 tokens, and OpenAI's flagship prices are short context rates, defined as ≤272K input tokens. Both apply here. Also, token counts are not identical across providers: Anthropic notes that its newer tokenizer "produces approximately 30% more tokens for the same text" than older Claude models, so measure your own task on each candidate rather than assuming the same count.
The table shows why model choice is the biggest single lever: the same task costs 100 times more on GPT-6 Astra than on the small models in the top row.
How much does prompt caching save on an agent?
A lot, because an agent's context is mostly repeated. With automatic caching, Anthropic moves the cache point forward each turn, so every call reads the previous context from cache and writes only the new part. On Claude Sonnet 5.5 a cache write costs 1.25 times base input ($2.50 per million) and a cache hit costs 5% of the standard input price ($0.10 per million).
Redo the example with caching on:
- Writes: the first call's 5,500 tokens plus 2,400 new tokens on each of the next five calls, so 17,500 tokens × $2.50 per million = $0.04375.
- Reads: each call after the first reads the previous call's full input from cache, so 5,500 + 7,900 + 10,300 + 12,700 + 15,100 = 51,500 tokens × $0.10 per million = $0.00515.
- Output is unchanged at $0.024.
Total: about $0.073 per task instead of $0.162, or $145.80 instead of $324 for 2,000 tasks. OpenAI's guide lists the same structure for GPT-5.6 and later: cache writes cost 1.25× the standard, uncached input-token rate, with reads at 0.05× on GPT-6.1 Sol, although where its cache breakpoints fall differs. Our prompt caching guide explains what silently breaks a cache.
What other running costs should you budget for?
Tool fees. Both providers charge for web search on top of tokens: Anthropic at $10 per 1,000 searches, OpenAI at $10.00 per 1k calls plus the search content tokens. Three searches per task at 2,000 tasks a month is 6,000 searches, or $60, which is more than the cached model cost in the example above. OpenAI's file search also bills $2.50 per 1,000 tool calls and $0.10 per GB per day of storage after the first free GB.
Hosting. If you run the loop on a provider's managed agent service, runtime is billed too: Anthropic's Claude Managed Agents charges $0.08 per session-hour of running time on top of tokens. Self-hosting means paying for the server, logs and monitoring instead.
Human review. This is often the largest line and the one most estimates leave out. Use the same arithmetic: if 10% of 2,000 tasks escalate and each takes a person 4 minutes, that is 800 minutes, about 13 hours a month. Multiply by your own staff cost.
How do you keep AI agent costs under control?
- Route with a small model. Anthropic positions Haiku 5.5 for "high-volume, latency-sensitive tasks such as classification, extraction, and routing". Let it sort and triage, and send only the hard cases to a larger model.
- Cache the stable prefix. Put tool definitions and instructions first and keep them byte-for-byte identical, so every call reads them at the cache rate.
- Cap the loop. Anthropic notes it is common to include stopping conditions (such as a maximum number of iterations) to maintain control, and OpenAI says to set limits on agent retries or actions and escalate when they are exceeded. A cap turns an open-ended cost into a bounded one.
- Batch what can wait. Anthropic's Batch API gives a 50% discount on both input and output tokens, and OpenAI's Batch API offers a 50% cost discount compared to synchronous APIs with completion within 24 hours. Overnight reports qualify; live replies do not.
- Trim tool results. A tool that returns a 2,000 token record when the agent needs 200 tokens multiplies cost on every later step.
- Measure cost per completed task. Track it next to completion rate and escalation rate. Anthropic's summary applies: agentic systems often trade latency and cost for better task performance, so check the performance actually arrived.
If you would rather know the number before you commit, we scope the process with you and give a fixed quote for an AI agent, with the running cost estimated from your own volumes using the method above.
Frequently asked questions
Is it cheaper to use an off-the-shelf agent than to build one?
For a generic job, often yes, because the build cost is shared across many customers.
A custom agent earns its cost when the job depends on your own systems, data and rules.
Compare both on cost per completed task over a year, review time included.
Why is my agent bill higher than my estimate?
Usually the loop ran more steps than planned, tool results were larger than expected, or the cache kept missing.
Check the usage fields in each response: Anthropic reports cache_creation_input_tokens and cache_read_input_tokens separately, so a cache that never shows reads is being invalidated somewhere upstream.
Do multi-agent systems cost more than a single agent?
Yes, by a wide margin.
Anthropic measured multi-agent systems at about 15× more tokens than chats, against about 4× for a single agent, and says they need tasks where the value is high enough to pay for the increased performance.
Start with one agent.
How do I estimate tokens before I build anything?
Take five real cases, write down what the agent would read at each step (instructions, documents, tool results) and how many steps it would need, and run that text through the provider's token counter; Anthropic recommends you count it with token counting and that model's ID, because the count differs by model.
Once a prototype exists, replace the estimate with the counts reported in each API response.
