Guide · 4 min read · Updated

What an AI agent costs to run: per task and per month

An AI agent costs more than a chatbot because it calls the model several times per task and re-sends a growing context each time. At list prices checked on 28 October 2026, a typical 8-step task is about 76,400 tokens and costs about $0.09 on Claude Sonnet 5.5 with 60% of input served from cache, $0.18 on Claude Opus 5.5 and half a cent on Claude Haiku 5.5. At 50 tasks a day with 10% retried, that is about $147, $293 and $8 a month respectively.

This guide shows where those numbers come from, what a change in steps or caching does to them, and what is not included. The maths is the one our agent cost estimator runs; the prices are the ones in /data/prices.json.

Why agents cost more than chat

A chat message is one request: the instructions, the conversation so far and the new message go in, a reply comes out. An agent loops: the model reads the task, decides to call a tool (search, read a file, query a database), gets the result, decides the next step, and so on until it is done. Each of those decisions is a separate request, and each request contains everything that happened before it.

So with fixed instructions of S tokens and G new tokens of tool results and replies per step, step n sends S + (n − 1) × G input tokens. Over k steps the input adds up to k × S + G × k(k − 1)/2. The second term grows with the square of the number of steps. That is the whole story of agent cost: doubling the steps roughly quadruples the context part of the bill.

The example task

Take an agent with:

  • 8 steps (model calls) per task
  • 4,000 tokens of instructions and tool definitions, re-sent every step
  • 1,500 new tokens of context per step (the tool result and the model’s last reply)
  • 300 output tokens per step
  • 50 tasks a day, of which 10% are retried after a failed tool call
  • 60% of input served from the prompt cache (the instructions and the older context)

Input per task: 8 × 4,000 + 1,500 × (0 + 1 + … + 7) = 32,000 + 42,000 = 74,000 tokens. Output: 8 × 300 = 2,400 tokens. Total 76,400 tokens per task. Runs per month: 50 × 30.4 × 1.1 = 1,672.

What that costs on each model

Prices per million tokens are from the table in what the Claude API costs; cache reads are $0.01 on Haiku 5.5, $0.10 on Sonnet 5.5, $0.20 on Opus 5.5 and $0.25 on Fable 5.1.

ModelPer task, no cachePer task, 60% cachedPer month (1,672 runs, 60% cached)
Claude Haiku 5.5$0.0086$0.0046$7.70
Claude Sonnet 5.5$0.172$0.088$146.53
Claude Opus 5.5$0.344$0.175$293.07
Claude Fable 5.1$0.86$0.427$714.11

Two things stand out. Caching halves the Sonnet 5.5 cost ($0.172 to $0.088) because 97% of the tokens in an agent task are input, and most of that input is repeated. And the 20× price gap between Haiku and Sonnet turns into a $139-a-month gap at this volume: if Haiku 5.5 can do the routine steps reliably, that is the single biggest saving available.

For comparison on the same task, Gemini 3.8 Flash comes to about $58 a month and GPT-6.1 Sol has the same list prices as Sonnet 5.5, so the same $147. The estimator shows all eleven models we track.

Steps, not tokens, are the lever

Keep everything else fixed and change only the number of steps (Sonnet 5.5, 60% cached):

Steps per taskInput tokens per taskCost per task
425,000$0.034
874,000$0.088
16244,000$0.258

Going from 8 to 16 steps triples the cost; going from 8 to 4 cuts it by 62%. An agent that wanders, re-reads the same file, or retries a tool call three times is spending that money on nothing. Cap the steps, make tool errors return a clear message the model can act on, and validate tool inputs before you let the model try again.

Five ways to make an agent cheaper

  1. Cache the fixed part. Put instructions, tool definitions and reference material first in the prompt so every step after the first reads them from cache. In the example this is worth about $75 a month on Sonnet 5.5.
  2. Trim tool results. A search tool that returns 5,000 tokens when 500 would do inflates every later step too, because the result stays in the context.
  3. Cap steps and retries. Set a hard limit per task and return a partial result instead of looping.
  4. Route by difficulty. Use Haiku 5.5 for the routine steps (parse this, pick a tool, format that) and Sonnet 5.5 or Opus 5.5 only for the step that needs judgement.
  5. Batch what can wait. Agents that run on a schedule rather than for a waiting user can use the Batch API at half price.

What is not in these numbers

  • Tool costs. Search APIs, browser sessions, code sandboxes and third-party data are billed by their providers.
  • Hosting. The agent needs a process somewhere to run the loop. A $5 server is enough for one like this; see the ledger for what ours cost.
  • Long-context surcharges. Haiku 5.5 charges five times more for a request whose prompt is over 100,000 tokens. The 16-step example above reaches 26,500 tokens on its last step, so it is fine; a 40-step agent would not be.
  • Your time. Watching logs and fixing prompts is the real cost of a young agent.

Run your own numbers in the agent cost estimator, and if you would rather have the agent built and run for you, the build page lists three example tools with their monthly running cost.

Questions

How much does an AI agent cost per task?

A typical small agent task of 8 model calls, with 4,000 tokens of instructions re-sent each time and 1,500 new tokens of tool results per step, is about 76,400 tokens. At list prices checked on 28 October 2026 that is about $0.09 on Claude Sonnet 5.5 with 60% of input cached, $0.18 on Claude Opus 5.5 and $0.005 on Claude Haiku 5.5. Without caching, Sonnet 5.5 is about $0.17.

Why is an agent so much more expensive than a chat message?

Because every step re-sends everything that came before: the instructions, every tool result and every earlier reply. A chat message is one request; an 8-step agent task is eight requests whose input grows each time, so it sends about 74,000 input tokens where a single message sends 3,000.

What is the cheapest way to cut an agent's bill?

Cache the fixed instructions and tool definitions (about half the bill in the example), cap the number of steps, and trim tool results before they go back into the context. Then route the simple steps to a cheaper model.

Sources

  1. Pricing (Claude API) . Anthropic
  2. Prompt caching . Anthropic
  3. Gemini Developer API pricing . Google

Prices in this guide were checked on the date shown above and change often. Check each provider's pricing page before you commit.

Price Watch: AI and hosting price changes, once a month

One short email a month: which model and hosting prices changed, what that does to a typical small-app bill, and one update from our own ledger. Free, unsubscribe any time.

We'll email you once to confirm. See the privacy policy.