Most "AI agent cost" articles answer a different question: what it costs to build one. This one is about what it costs to run one, per run and per customer, and why the answer is usually higher than a quick token estimate suggests.
Why agents cost more than chat
A chat reply is one request. An agent run is a loop: the model calls a tool, the tool's result is appended to the conversation, and the model is called again with everything so far. Each turn re-sends the system prompt, the tool definitions, every earlier tool result and every earlier reply. Input grows with every step, and you pay for all of it again on each turn.
A worked example
A fictional 10-turn agent run: a 6,000-token system prompt and tool list, a 300-token user request, and on each turn 400 output tokens followed by a 1,500-token tool result. Priced at GPT-6.1 Sol's standard rates as of October 23, 2026: $2 per 1M input tokens and $10 per 1M output tokens.
| Turn | Input tokens | Cost of that turn |
|---|---|---|
| 1 | 6,300 | $0.0166 |
| 5 | 13,900 | $0.0318 |
| 10 | 23,400 | $0.0508 |
| Whole run (10 turns) | 148,500 in · 4,000 out | $0.3370 |
- Input is 88% of the cost. The model only wrote 4,000 tokens. It read 148,500.
- The tenth turn costs about 3× the first, purely because the context is longer.
- Twenty runs a day for a month is about $202 for one customer, without caching.
What prompt caching does to it
Almost everything an agent sends is a repeat of the previous turn, which is exactly what prompt caching is for. On GPT-5.6 and later models, OpenAI bills a cache write at 1.25× the input rate and a cache read at 0.05× on GPT-6.1 Sol. Assuming each turn reads the previous turn's input from cache and writes only the new tail:
| Same run (fictional) | No caching | Ideal caching |
|---|---|---|
| Input | $0.2970 | $0.0710 |
| Output | $0.0400 | $0.0400 |
| Cost per run | $0.3370 | $0.1110 |
| 20 runs a day, 30 days | $202.20 | $66.61 |
That's about two-thirds off, and it's a best case: every turn has to land within the cache lifetime and keep an identical prefix. Change the system prompt per run, reorder tools, or put a timestamp at the top, and you're back to the left column.
What actually drives the bill
- Number of turns. Cost grows faster than linearly with turns, because each turn re-reads the last.
- Size of tool results. A tool that returns a whole web page or file adds those tokens to every later turn.
- Reasoning tokens. On reasoning models, hidden reasoning is billed as output, so a short visible reply can still be expensive.
- Retries and loops. A run that fails and restarts pays for the context again. An agent stuck in a loop pays every turn until something stops it.
- Model choice per step. Routing simple tool-selection turns to a smaller model cuts the most frequent cost.
From cost per run to cost per customer
Cost per run is an engineering number. The business number is cost per customer, because customers differ wildly in how often they run agents and how long those runs get. To get it, record every model call in a run against the customer who started it, price each call at the rate in effect at the time, and compare the total with what that customer pays.
AgentMargin does that last part. Track each completed call with its customer ID, and the local dashboard shows revenue against known AI cost per customer, with loss-making customers flagged and unpriced events kept as unknown rather than $0. See LLM cost per user for what to do once you can see the distribution.


