What AI costs
What an AI Agent Costs to Run, With the Arithmetic Shown
Running cost is driven by how much text the agent re-reads each turn, not by which model you picked. An agent re-sends its system prompt and tool definitions on every turn, so that fixed prefix is the largest repeated charge in a run. Caching it cuts the cost of those tokens by 80 to 95 percent, and it pays for itself from the third turn onward. Get that wrong and no model choice will rescue the bill.
We do this for clients:Agentic AI DevelopmentDigital FTE Development
Why published agent costs are all useless
Search for what an AI agent costs and you get ranges: a few hundred a month, or tens of thousands, depending on complexity. The ranges are not wrong. They are unfalsifiable, because none of them shows a calculation you could check against your own case.
The inputs are public. Every major vendor publishes per-token prices. What is missing from the published content is the structure of an agent run, and that is what decides the bill.
The one thing about agents that costs money
A chatbot answers a question and forgets it. An agent works through a task in turns: it thinks, calls a tool, reads the result, thinks again. That loop is what makes it useful and it is also what makes it expensive, for a reason that is not obvious until you see a bill.
On every turn, the model is re-sent the whole conversation so far. Your system prompt, your tool definitions, the earlier turns and every tool result already returned. Nothing is remembered between calls; it is all re-read.
So a ten-turn agent run does not cost ten times one turn. It costs closer to the sum of a growing context, and the fixed part at the front, the system prompt and tool definitions, is paid for ten times over.
Published API prices
US dollars per million tokens, read from each vendor's own pricing page on 11 September 2026. List prices, standard processing.
| Model | Input | Output | Cached input |
|---|---|---|---|
| Claude Opus 5 | $5 | $25 | $0.50 |
| Claude Sonnet 5 | $2 | $10 | $0.20 |
| Claude Haiku 4.5 | $1 | $5 | $0.10 |
| GPT-6 Astra | $10 | $50 | $1.00 |
| GPT-5.6 Terra | $2 | $12 | $0.20 |
| GPT-5.6 Luna | $0.20 | $1.20 | $0.02 |
Look at the last column rather than the first. Cached input on Anthropic's models is one twentieth of fresh input. On OpenAI's it is one tenth. That ratio, not the difference between models, is the largest lever available to you.
How to work out your own number
Four inputs, and you can get all of them before writing any code. Do this on the back of an envelope before committing to a build.
- 1
Measure your fixed prefix
Count the tokens in your system prompt plus your tool definitions. This is re-sent every single turn and is usually the biggest surprise: a dozen tools with thorough descriptions runs to several thousand tokens before the user has said anything.
- 2
Estimate turns per task
How many tool calls does the agent make before it is done? A lookup-and-answer agent might be two or three. A research or multi-step operational agent is commonly ten to twenty, and a stuck one is more.
- 3
Multiply, then add the growth
Fixed prefix times turns gives your floor. Then add the accumulating conversation: each tool result stays in context for every subsequent turn, so a verbose tool is charged repeatedly rather than once.
- 4
Apply the cache, then multiply by volume
Move the fixed prefix to the cached rate, add one cache write per run, and multiply by how many times a day this runs. That is your monthly figure, and it is checkable rather than asserted.
A worked example
Take an agent with a 20,000-token fixed prefix, which is an ordinary size once you have a real system prompt and eight or ten tools defined. Say it runs twelve turns to finish a task, and you are using Claude Opus 5 at $5 per million input tokens.
Uncached, that prefix alone costs 20,000 × 12 = 240,000 input tokens, or $1.20 per run, before a single tool result or output token is counted.
Cached, you pay one cache write at $6.25 per million, then eleven reads at $0.50 per million: about $0.23 per run. The same work, 80 percent cheaper, with no change to the model or the prompt.
At a thousand runs a day that is the difference between roughly $1,200 and $230 a month, on the prefix alone.
What this means for choosing a model
Model choice matters less than the loop does. A well-built agent on an expensive model routinely costs less to run than a badly built one on a cheap model, because the badly built one re-sends everything at full price on every turn and takes more turns to finish.
The sensible order is: get the loop right, cache the fixed prefix, keep tool results terse, and only then argue about models. Most teams do this in reverse and spend the argument on the smallest variable.
There is a real caveat in the price table above, worth stating because it will date this post: the GPT-5.6 Sol price is explicitly promotional, published as available at least through 21 November 2026. Any arithmetic built on a promotional rate has an expiry attached to it.
What we look at first on a real build
We build agentic AI systems, and the running-cost conversation almost never starts in the right place.
It starts with which model, because that is the visible decision and the one with opinions attached to it. The three things that actually move the bill are the size of the fixed prefix, whether it is cached, and how verbose the tools are, and none of those is a procurement question. They are architecture.
The tool verbosity one is the most commonly missed. A tool that returns a whole record when the agent needed one field does not cost you once, it costs you on every subsequent turn, because that output stays in the context for the rest of the run. Trimming what tools return is usually the second-largest saving available after caching, and it takes an afternoon.
What this post is not costing
Three things, all of which are frequently larger than the API bill.
The build. Designing, writing and testing an agent is engineering work and it dominates year one for most projects.
The failures. An agent that loops, retries or gets stuck still burns tokens, and the pathological cases are the expensive ones. Budget for the agent that does not work, not only the one that does.
The people. Someone has to watch what the agent is doing, and that is not free either. The published three-year comparisons that omit this are the reason cost estimates come in so low.
What this does not cover
- List prices on one date. These change often, and one of them is explicitly promotional with a stated end date.
- The worked example uses a 20,000-token prefix and twelve turns because those are ordinary, not because they are yours. The method is the point; substitute your own numbers.
- Output tokens are not modelled in the worked example, which isolates the prefix effect. Output is charged at five times input on most models and matters for verbose agents.
- Build cost, failure cost and supervision are excluded and are frequently larger than the API bill.
Sources
Every figure above comes from one of these, read on the date shown. Prices change: if you are reading this long after that date, check before you rely on it.
- Anthropic pricing
Claude input, output and prompt-caching read and write prices, and the batch discount.
Read 11 September 2026
- OpenAI API pricing
GPT model input, output and cached-input prices, and the promotional rate caveat.
Read 11 September 2026
Questions
The questionspeople ask
What does an AI agent cost per month?
It depends on your fixed prefix, your turns per task and your volume, and anyone quoting a figure without those three has guessed. As a worked example: a 20,000-token prefix, twelve turns, a thousand runs a day, on Claude Opus 5 with caching, is roughly $230 a month for the repeated prefix. Uncached, the same work is about $1,200.
Does prompt caching actually save money?
Yes, on anything that re-reads the same context. Cached input is one twentieth of fresh input on Anthropic's models and one tenth on OpenAI's. The cache write costs 1.25 times an ordinary read, so you are behind after one use and ahead from the third, which makes it close to free money for an agent and a small loss for a one-shot call.
Is a cheaper model the way to cut agent costs?
Usually not first. The loop structure and caching move the bill by multiples; model choice moves it by a factor of two to five. A cheaper model that needs more turns to finish can cost more overall, and it is also the change most likely to degrade the output.
Why does my agent bill grow during a single task?
Because context accumulates. Every tool result stays in the conversation for every later turn, so a verbose tool output is charged again on each subsequent call. Trimming what tools return is often the single highest-leverage change after caching.
Are batch discounts worth using for agents?
Both Anthropic and OpenAI publish 50 percent batch discounts, but batch processing is asynchronous. It suits bulk classification or summarisation, not an agent a user is waiting on. If your agent runs overnight against a queue, it is worth looking at.
Want the arithmetic run on your agent?
Tell us what the agent does, roughly how many tools it has and how often it runs. We will do the calculation above against your case and say plainly whether the running cost is the thing you should be worried about.
