# What AI agents really cost in 2026: a guide for CEOs and CFOs

URL: https://infro.io/blog/what-ai-agents-cost-2026
Author: INFRO Editorial (https://infro.io/blog/editorial)
Publisher: INFRO
Published: 2026-10-27
Last modified: 2026-10-27
Last reviewed: 2026-10-27 (next review due 2026-11-26)
Topic: Agents and multimodal systems
Format: Guide

> One AI agent task costs the sum of its steps: every step resends the growing conversation as input, bills reasoning as output, and may add tool fees (web search lists at $10 per 1,000 calls on both OpenAI and Anthropic, plus the result tokens) and hosted compute, such as OpenAI-hosted sandboxes, billed only during active turns since 9 October 2026. Because context grows with each step, cost grows faster than step count, and a loop that runs four times as many steps can cost more than four times as much. Bound every run with step, token, time and spend limits, give each agent its own key with a hard cap, and keep a switch that stops it.

Key takeaways:
- An agent step resends the whole conversation so far, so input tokens grow with every step and cost grows faster than step count.
- Reasoning is billed as output on every step; on agent loops the planning steps carry most of it.
- Web search lists at $10 per 1,000 calls on both OpenAI and Anthropic, plus the result tokens, which are billed as input on later steps too.
- Hosted compute is a separate line: OpenAI-hosted sandboxes bill only active turns since 9 October 2026; Claude Managed Agents bill $0.08 per running session-hour.
- Coding agents can be bought per seat or per token; the two are priced differently and should be budgeted and measured separately.
- Every agent needs four limits per run (steps, tokens, time, money) and an outer cap on its key that it cannot exceed whatever its code does.

An AI agent task costs the sum of its steps, and each step costs more than the last. Every step sends the conversation so far as input, generates reasoning and an answer billed at the output rate, and may call tools that carry their own fees and run in compute that is billed separately. A 10-step task is not ten times a chat request; it is closer to the cost of a long conversation, and an agent that loops 40 times instead of 10 can cost more than four times as much. This guide breaks the bill into its parts, works one task through at list rates, and sets out the budgets, limits and questions that keep agent spend bounded.

## What an agent bill is made of

| Component | How it is billed | What drives it |
| --- | --- | --- |
| Input tokens per step | Model input rate; cached prefix at the cache-read rate | Context grows every step: system prompt, tool definitions, earlier steps and tool results |
| Output and reasoning tokens | Model output rate, typically several times the input rate | Effort setting, task difficulty, planning steps |
| Tool calls | Per call, plus result tokens at model rates | Searches, fetches, file search, computer use |
| Hosted compute | Per container session, container-hour or session-hour | Code execution, sandboxes, long-running sessions |
| Retries and loops | Every repeated step is billed again | Errors, timeouts, an agent that does not converge |
| Seats (coding agents) | Per user per month, with usage limits | Number of developers, plan tier |

Table: The parts of an agent's cost and what moves each one.

### Tokens per step, and why context grows

A chat request sends one prompt. An agent step sends the system prompt, the tool definitions, the user's task and everything that happened in earlier steps: the model's own messages, its tool calls and every tool result. A web page fetched at step 2 is still in the input at step 9 unless the agent trims it.

Tool definitions add tokens on their own. Anthropic, for example, adds a tool-use system prompt of 286 tokens on Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 whenever tools are provided, on top of the tool names, descriptions and schemas you send[1]. An agent with thirty tools carries their schemas on every step.

Prompt caching is what makes long agent contexts affordable. On Claude Opus 5.5 and Sonnet 5.5, a cache hit costs 0.05 times the base input price, while a 5-minute cache write costs 1.25 times[1]. On OpenAI, GPT-6 Sol lists cached input at $0.20 against $2.00 uncached[2].

### Reasoning tokens

Thinking models bill their reasoning as output, and output is the expensive side. On agent loops the cost is uneven: steps that plan carry most of the reasoning, steps that only read a tool result carry less. Anthropic notes that you cannot turn thinking off on Opus 5.5, Sonnet 5.5, Haiku 5.5 or the Fable models in Claude Code[3]; lowering effort is the lever. How each provider counts reasoning is in [reasoning tokens: the hidden cost of thinking models](https://infro.io/blog/reasoning-tokens-cost).

### Tool calls

Server-side tools are billed per use on top of tokens:

- **Web search.** OpenAI lists $10.00 per 1,000 calls, with search content tokens billed at model rates[2]. Anthropic lists $10 per 1,000 searches plus the tokens of search-generated content, and counts search results as input tokens both within the turn and in later turns[1].
- **Web fetch.** Anthropic charges no fee beyond the tokens of the fetched content[1], which can still be large: a fetched page stays in context.
- **File search.** OpenAI lists $2.50 per 1,000 tool calls plus $0.10 per GB per day of storage after the first GB[2].

The fee per call is small. The tokens a search or fetch adds to every later step are usually larger.

### Hosted sandboxes and code execution

Agents that run code need somewhere to run it, and that compute is billed apart from tokens.

- **OpenAI.** Hosted Shell and Code Interpreter containers are listed at $0.03 (1 GB), $0.12 (4 GB), $0.48 (16 GB) or $1.92 (64 GB) per 20-minute session per container, and the same page says eligible sessions are billed by the minute with a 5-minute minimum[2]. On 9 October 2026 OpenAI changed sandboxes used by the Agents API: "OpenAI-hosted sandbox compute is now billed during active turns," with no charge for idle time between turns, and added pre-warming of a sandbox before it is attached to a session[4].
- **Anthropic.** The code execution tool is free when web search or web fetch is in the same request; otherwise each organization gets 1,550 free hours a month and then pays $0.05 per hour per container[1]. Claude Managed Agents bill tokens plus $0.08 per session-hour of runtime, measured only while the session is `running`; idle time does not count, and it replaces container-hour billing[1].

For a short task, compute is small next to tokens. For a sandbox held open on large memory it is not: a 64 GB container at $1.92 per 20 minutes is $5.76 an hour if it stays busy. The 9 October change matters most for agents that wait on people between turns.

### Retries and loops

A retried step is billed again in full, including its whole context. A loop that does not converge is the largest single cost risk in agent systems, because context keeps growing while it runs. Bounding loops is covered in detail in [bounding AI agent loops](https://infro.io/blog/bound-ai-agent-loops).

## One agent task, worked through

> **Example: A research agent at list rates (illustrative)**
> A research agent answers one question in 10 steps. The system prompt, tool definitions and task total 7,000 tokens. Each step produces 1,500 output tokens (reasoning, a message and a tool call) and gets back a 2,500-token tool result, so the context grows by 4,000 tokens per step. Six of the steps are web searches.
> 
> **On Claude Opus 5.5** ($4 input, $5 for 5-minute cache writes, $0.20 cache reads, $20 output per 1M tokens[1]), with each step's new content cached:
> 
> - Cache reads: 207,000 tokens × $0.20/1M = $0.041
> - Cache writes: 43,000 tokens × $5/1M = $0.215
> - Output: 15,000 tokens × $20/1M = $0.300
> - Web search: 6 × $10/1,000 = $0.060
> - **Total: about $0.62** for the task. Without caching, the same 250,000 input tokens at $4/1M would put tokens alone at $1.30.
> 
> **On GPT-6 Sol** ($2 input, $0.20 cached input, $10 output per 1M tokens[2]), same shape: about $0.28 in tokens plus $0.06 for search, **about $0.34**, before any container time.
> 
> **The same task, allowed to run 40 steps.** Context reaches 163,000 tokens by the last step. On Opus 5.5 with caching, tokens come to about $2.66, plus searches: **about $2.72**, four times the steps and more than four times the cost. Without caching, tokens alone would be about $14.80.
> 
> Token counts are hypothetical and the totals exclude result tokens beyond the 2,500 per step, compute, retries and your own infrastructure. Measure your agents' real step counts and context sizes.

Two conclusions survive any change to the inputs. Step count is the variable that matters most, because context, and therefore input, grows with it. And caching is not optional for agents: it is the difference between a context that costs little to resend and one that dominates the bill.

At volume the per-task numbers become a budget line. At $0.62 a task, 2,000 tasks a day is about $1,240 a day of estimated provider usage, roughly $37,000 over a 30-day month. If one task in fifty loops to 40 steps, the month gains about $2,500 more.

## Coding agents: seats versus API usage

Coding agents are the agents most companies already run, and they are bought two ways.

|  | Per seat | Per token (API) |
| --- | --- | --- |
| Example | ChatGPT Business, which includes Codex: $20 per user per month billed annually, $25 monthly[5] | Codex with an API key, or Claude Code on API billing, at API rates[5][3] |
| Cost shape | Fixed per person | Scales with use |
| Ceiling | Usage limits per window; Claude Team and Enterprise seats draw on an allowance shared with Claude chat[3] | None unless you set one |
| Visibility | Vendor admin analytics | Per-key usage, cost APIs, telemetry |
| Fits | Interactive individual use | Automation, CI, shared agents, heavy users |

Table: Two ways to pay for coding agents.

For budgeting, Anthropic reports that across enterprise deployments Claude Code on API billing averages around $13 per developer per active day and $150 to $250 per developer per month, with 90% of users under $30 per active day[3]. It also notes that agent teams use roughly seven times more tokens than standard sessions when teammates run in plan mode[3]. OpenAI warns that API token prices are separate from subscription usage and should not be used to estimate what a seat includes[5]. The full comparison is in [coding agent costs for teams](https://infro.io/blog/coding-agent-costs-for-teams).

## Budgets and kill switches

Agent spend needs limits at three levels, and each level catches what the one inside it misses.

1. **Per run, in the agent's code.** A maximum number of steps, tokens, wall-clock time and estimated spend. When any is reached, the run stops and reports why. This is the cheapest control and the easiest to bypass by a bug.
2. **Per agent, outside the code.** Give each agent or worker its own API key with a hard spend limit, daily or lifetime. Whatever the loop does, the key cannot spend past it. Set `max_tokens` on every call so a single step cannot run away.
3. **Per organization and per provider account.** A monthly cap and alerts, and the provider's own spend limit on the account, which holds even if everything in front of it fails.

A kill switch is a control that stops model calls immediately without deploying code: disabling the agent's key, or a provider-side limit set to zero. Test it before you need it, and write down who may use it.

## Questions to ask the team

- How many steps does a typical run take, and what is the 95th percentile? What stops a run that does not converge?
- What is the cost per completed task, and per failed one? How many runs fail?
- Is prompt caching working, and what share of input tokens are cache reads?
- Which tools does the agent call, at what fee, and how much context does each result add?
- Where does code run, and is that compute billed while idle?
- Does each agent have its own key with a hard limit, and who can turn it off?
- For coding agents: how many seats are used, how much API spend sits beside them, and what has changed in lead time or merged changes since rollout?

## Capping agent spend with INFRO

INFRO is a control plane between your agents and the provider accounts you connect; your providers bill you directly, and INFRO's limits act on its estimate of that provider cost.

**A key per agent, with a hard cap.** A gateway key can carry a spend limit that resets daily, weekly or monthly, or a lifetime limit; key limits always block, and a request over one returns `402` with a code such as `key_budget` or `key_lifetime_limit` before the provider is called. A key can also be turned off, after which its requests return `403 key_disabled`, which is the kill switch above. See [spend controls](https://infro.io/docs/org/spend-controls) and [authentication](https://infro.io/docs/authentication).

**Reservation before the call.** A blocking budget admits a request only if its worst-case estimated cost fits the room left, counting requests still in flight; a chat request with no `max_tokens` reserves the model's maximum output, so setting it lets more concurrent steps fit.

**Cost per run.** Tag each call with `metadata.trace_id`, and [request traces](https://infro.io/docs/observability/traces) return every request in the run with estimated cost by step. Per-customer caps on `metadata.user_id` bound what each of your customers' agent runs can spend ([end-customer caps](https://infro.io/docs/org/end-customer-caps)). Claude Code and Codex can be pointed at INFRO with a base URL and a gateway key, so the same limits apply to them ([coding agents](https://infro.io/docs/coding-agents)).

What INFRO does not cover: provider-side tool fees and hosted sandbox or container compute are billed by your provider and are outside INFRO's estimates, and seat-based plans such as ChatGPT Business never pass through INFRO. Keep provider-side spend limits on as well.

## Questions

### How much does one AI agent task cost?

It depends on steps, context size, model and tools, so measure your own. As an illustration at list rates, a 10-step research task on Claude Opus 5.5 with prompt caching and six web searches comes to about $0.62; the same task allowed to run 40 steps comes to about $2.72.

### Why does an agent cost more than the same number of chat requests?

Each step sends the whole conversation so far, including earlier tool results, so later steps carry far more input than the first. Prompt caching lowers the rate on the repeated part but does not remove it.

### Are web search and sandboxes billed separately from tokens?

Yes. OpenAI and Anthropic both list web search at $10 per 1,000 calls plus the result tokens at model rates. Hosted code execution and sandboxes have their own compute charges, listed per container session on OpenAI and per container-hour or session-hour on Anthropic.

### Is a coding agent seat or API billing better?

Seats give a predictable per-person cost with usage limits; API billing scales with use and has no allowance ceiling. Heavy, automated or shared use tends to suit API billing with spend limits; individual interactive use tends to suit seats. Pilot both and compare cost per merged change.

### What is an agent kill switch?

A control outside the agent's own code that stops its model calls at once, such as turning off the API key the agent uses or a provider-side spend limit. In-process limits do not help when the process itself is the problem.

## Sources

1. Pricing — Anthropic. https://platform.claude.com/docs/en/about-claude/pricing (accessed 2026-10-27)
2. Pricing — OpenAI. https://developers.openai.com/api/docs/pricing (accessed 2026-10-27)
3. Manage costs effectively — Anthropic. https://code.claude.com/docs/en/costs (accessed 2026-10-27)
4. Changelog — OpenAI. https://developers.openai.com/api/docs/changelog (accessed 2026-10-27)
5. Pricing — OpenAI (ChatGPT). https://learn.chatgpt.com/docs/pricing (accessed 2026-10-27)
