Skip to content

Agents and multimodal systemsGuide

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

An agent's price is not the model's price. Each step resends a growing context, thinks at the output rate, may call paid tools and run in billed compute, and a loop multiplies all of it. Here is the arithmetic for one task at list rates, and the limits that keep the total bounded.

By INFRO Editorial

Published

9 min read

An amber loop on a dark ground, each pass drawn wider than the last, with a bright mark where the loop is cut

In short

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

ComponentHow it is billedWhat drives it
Input tokens per stepModel input rate; cached prefix at the cache-read rateContext grows every step: system prompt, tool definitions, earlier steps and tool results
Output and reasoning tokensModel output rate, typically several times the input rateEffort setting, task difficulty, planning steps
Tool callsPer call, plus result tokens at model ratesSearches, fetches, file search, computer use
Hosted computePer container session, container-hour or session-hourCode execution, sandboxes, long-running sessions
Retries and loopsEvery repeated step is billed againErrors, timeouts, an agent that does not converge
Seats (coding agents)Per user per month, with usage limitsNumber of developers, plan tier
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 send1. 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 times1. On OpenAI, GPT-6 Sol lists cached input at $0.20 against $2.00 uncached2.

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 Code3; lowering effort is the lever. How each provider counts reasoning is in reasoning tokens: the hidden cost of thinking models.

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 rates2. 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 turns1.
  • Web fetch. Anthropic charges no fee beyond the tokens of the fetched content1, 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 GB2.

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 minimum2. 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 session4.
  • 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 container1. 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 billing1.

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.

One agent task, worked through

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 seatPer token (API)
ExampleChatGPT Business, which includes Codex: $20 per user per month billed annually, $25 monthly5Codex with an API key, or Claude Code on API billing, at API rates53
Cost shapeFixed per personScales with use
CeilingUsage limits per window; Claude Team and Enterprise seats draw on an allowance shared with Claude chat3None unless you set one
VisibilityVendor admin analyticsPer-key usage, cost APIs, telemetry
FitsInteractive individual useAutomation, CI, shared agents, heavy users
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 day3. It also notes that agent teams use roughly seven times more tokens than standard sessions when teammates run in plan mode3. OpenAI warns that API token prices are separate from subscription usage and should not be used to estimate what a seat includes5. The full comparison is in 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 and 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 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). 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).

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 readers ask

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.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

  • Budgets and spend ceilings

    Available with a plan

    A hard cap per organization, project, member, and key, with alerts at your own thresholds.

    Read the documentation for Budgets and spend ceilings
  • Key limits and rotation

    Available with a plan

    Limit a gateway key to chosen providers or IP ranges, and rotate it with an overlap window so the old key keeps working while you deploy the new one.

    Read the documentation for Key limits and rotation
  • End-customer spend caps

    Available with a plan

    One spend cap for every end customer of your product, per organization or per project, with overrides your backend sets through the management API. A refused request returns a 402 with the time the cap resets, for your app to show its user. Caps and the per-customer cost view on every plan.

    Read the documentation for End-customer spend caps
  • Request traces and payload logs

    Available with a plan

    Per-request timing detail, with prompt and completion logging off by default and a retention window you choose.

    Read the documentation for Request traces and payload logs
  • Claude Code and Codex through INFRO

    Available with a plan

    Point Claude Code, the Claude Agent SDK, Codex or the OpenAI Agents SDK at INFRO by changing the base URL and the key. Anthropic's Messages API and OpenAI's Responses API, with routing, budgets refused before the call, guardrails and the request log applied as on every other request.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.Pricing (opens in a new tab) — Anthropic. Accessed Oct 27, 2026.
  2. 2.Pricing (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  3. 3.Manage costs effectively (opens in a new tab) — Anthropic. Accessed Oct 27, 2026.
  4. 4.Changelog (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  5. 5.Pricing (opens in a new tab) — OpenAI (ChatGPT). Accessed Oct 27, 2026.

About this article

Prices and billing rules were read on 2026-10-27 from OpenAI's API pricing page and changelog, Anthropic's pricing page and Claude Code cost guide, and ChatGPT's Codex pricing page. The worked example is illustrative arithmetic at those list rates with hypothetical token counts; it is not a measurement of any agent. INFRO behaviour is described from its documentation.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.