InputsUSD · list prices from our catalog

Every step re-sends the whole conversation: the system prompt, the task, and every earlier output and tool result. Reasoning tokens bill as output but aren't sent back. With caching, the part already sent reads at the cached rate and only the new tokens bill as fresh input. Runs per task counts failed attempts you still pay for.

Ranking20 steps · 44.1K final context
Cheapest per task
$0.022/task
Claude Haiku 5.5 · $21.59/mo

Cheapest per task: Anthropic Claude Haiku 5.5 — $0.022 for 20 steps, $21.59/mo. By the last step the context is 44.1K tokens, and re-reading it is 44% of the bill. Without caching the same task costs $0.064.

  • Claude Haiku 5.5$0.022/task Anthropic $21.59/mo
  • GPT-6 Luna$0.022/task OpenAI $21.59/mo
  • DeepSeek V4.1 Flash$0.043/task DeepSeek $43.13/mo
  • MiniMax M3$0.069/task MiniMax $69.20/mo
  • Gemini 3.8 Flash$0.155/task Google $155/mo
  • DeepSeek V4 Pro$0.167/task DeepSeek $167/mo
  • GLM-5.3$0.284/task Zhipu $284/mo
  • Claude Sonnet 5.5$0.384/task Anthropic $384/mo

Rates from our model catalog, each verified on the vendor's pricing page. Long-context surcharges, batch pricing, tool-call fees (search, code execution) and cache storage not modeled.

Embed this calculator ↓
Start from your agent

Six agent profiles

Click one to load it. Step counts, token sizes and retry rates are scenario assumptions — replace them with numbers from your own traces. Verdicts are computed from the current catalog.

All models

Your agent on every model

The scenario configured above on all 15 models. Rates are each model's list price in our catalog; rows keep the default order while rank and costs recompute live. ✕ marks a final context larger than the model's window.

# Model Input / cached / output Context Final context Per task Uncached Per month
1 Claude Haiku 5.5 Anthropic $0.10 / $0.01 / $0.50 1M 44.1K $0.022 $0.064 $21.59
2 GPT-6 Luna OpenAI $0.10 / $0.01 / $0.50 1.1M 44.1K $0.022 $0.064 $21.59
3 DeepSeek V4.1 Flash DeepSeek $0.30 / $0.006 / $1.20 1M 44.1K $0.043 $0.185 $43.13
4 MiniMax M3 MiniMax $0.30 / $0.06 / $1.20 1M 44.1K $0.069 $0.185 $69.20
5 Gemini 3.8 Flash Google $0.75 / $0.075 / $3.75 1M 44.1K $0.155 $0.481 $155
6 DeepSeek V4 Pro DeepSeek $1.32 / $0.044 / $3.96 1M 44.1K $0.167 $0.783 $167
7 GLM-5.3 Zhipu $1.40 / $0.26 / $4.40 1M 44.1K $0.284 $0.835 $284
8 Claude Sonnet 5.5 Anthropic $2.00 / $0.10 / $10.00 1M 44.1K $0.384 $1.28 $384
9 GPT-6.1 Sol OpenAI $2.00 / $0.10 / $10.00 1.1M 44.1K $0.384 $1.28 $384
10 Grok 4.7 SpaceXAI $2.00 / $0.50 / $6.00 500K 44.1K $0.462 $1.19 $462
11 Kimi K3 Moonshot $3.00 / $0.30 / $15.00 1M 44.1K $0.619 $1.92 $619
12 Claude Opus 5.5 Anthropic $4.00 / $0.20 / $20.00 1M 44.1K $0.767 $2.56 $767
13 Qwen3.8 Max Alibaba $2.00 / — / $6.00 1M 44.1K $1.19 $1.19 $1,186
14 Claude Fable 5.1 Anthropic $10.00 / $0.25 / $50.00 1M 44.1K $1.80 $6.41 $1,797
15 GPT-6 Astra OpenAI $10.00 / $1.00 / $50.00 1.1M 44.1K $2.16 $6.41 $2,159

Rates per 1M tokens from our model catalog; each model links to its page, where the rate is dated and sourced. "Uncached" is the same task with caching off. The lineup is an editorial selection of each lab's current flagship and workhorse models, reviewed 2026-10-13.

Why steps compound

The same task, step by step

The default task on Claude Sonnet 5.5, stopped after a given number of steps. Context grows in a straight line; the tokens billed grow with its square.

Steps Context at last step Input billed (all steps) Cost, cached Cost, uncached
1 8K 8K $0.018 $0.028
5 15.6K 59K $0.089 $0.178
10 25.1K 165.5K $0.182 $0.451
20 44.1K 521K $0.384 $1.28
40 82.1K 1.8M $0.843 $4.08
How it works

The math behind the ranking

Rates come from our LLM pricing catalog, where each one is read from the vendor's pricing page and dated — a reprice there moves this page on the next build. One task is modeled as a loop:

context_1  = system + task
context_k  = context_(k−1) + output + tool_result          /* k ≥ 2 */

input      = Σ context_k                                    /* every step re-sends */
output     = steps × (output + reasoning)                   /* reasoning not re-sent */

/* with caching */
cached     = system + Σ context_(k−1)   for k = 2..steps
fresh      = input − cached                                 /* billed at cache-write rate if priced */

per_task   = cached × cached_rate + fresh × write_or_input_rate + output × output_rate
per_month  = per_task × runs_per_task × tasks

Not modeled: long-context surcharges above a model's threshold, batch pricing (agents run live), per-call tool fees such as web search or code execution, cache expiry between slow steps, parallel tool calls and sub-agents, and compaction once a run outgrows the window — flagged, not priced. Image inputs (screenshots) count as whatever token size you enter for tool results.

Full methodology lives at /methodology/. Found a stale rate? Report it.

Worked examples

Three trade-offs, real numbers

Computed from the current catalog on the default task unless noted.

Example 01 · steps
Twice the steps, 2.2× the bill
The default task on Claude Sonnet 5.5, run for 20 steps and then for 40. Each extra step re-sends a longer history than the last.
20 steps$0.384
40 steps$0.843
40 steps, uncached$4.08
2.2×
cost for 2× the steps
Example 02 · caching
Claude Opus 5.5, cached vs not
The default task on the frontier model. Most of every prompt is history the model has already seen.
Uncached$2.56/task
Cached$0.767/task
At 1,000 tasks$1,797/mo saved
−70%
per task with prompt caching
Example 03 · model choice
A small model's 40 steps vs a frontier model's 15
If the frontier model finishes in fewer steps, how much does that buy back? On this pair, not enough to close the gap.
Claude Haiku 5.5, 40 steps$0.051
Claude Opus 5.5, 15 steps$0.561
11×
frontier cost relative to the small model, with 63% fewer steps
Where the money goes

What the price per token doesn't show

01
Input, not output, is the agent bill

A 20-step task here sends 521K input tokens and generates 24K — because every step re-sends the whole conversation. Even with caching, re-reading history is 44% of the cheapest model's bill. Output prices make the headlines; input volume pays the invoice.

02
Caching is the biggest lever you control

With caching, the history each step re-sends reads at a fraction of the input rate — 5% of it on Claude Opus 5.5. On the default task that cuts the bill by 61%–79% across the models that offer it. Anthropic and OpenAI charge a premium to write the cache, which this calculator applies to every new token. Qwen3.8 Max has no cached rate in our catalog, so it pays full price for every step.

03
Reasoning is billed but never remembered

Thinking tokens bill at the output rate on every step, but the model doesn't send them back into the conversation, so they don't grow the context. They're why a frontier model's output line can rival its input line on short tasks — set the reasoning field to what your traces show.

04
Long runs hit the context window

The context grows by output + tool result every step. At the default pace that's 1.9K a step, so Grok 4.7's 500K window fills after about 260 steps. Past that an agent has to compact — summarise and restart — which this calculator flags rather than prices.

05
Failed runs cost the same as good ones

An agent that loops, stalls or gets the wrong answer still bills every step it took. "Runs per task" multiplies the month: 1.3 means three tasks in ten need a second attempt. A cheaper model that fails twice as often is not cheaper.

Agent costs — answered.

The questions this calculator exists for, answered with the current numbers. Every figure recomputes when a rate in the catalog changes.

Q · 01 How much does an AI agent cost to run? +
Per task, not per month, is the useful unit. A 20-step task with a 6K-token system prompt and 1.5K tokens of tool output per step costs $0.022 to $2.16 across the 15 models here, with caching on — $21.59 to $2,159 a month at 1,000 tasks.
Q · 02 Why do agents cost so much more than chat? +
Because each step re-sends everything before it. A chat reply bills one prompt; a 20-step agent bills 20 ever-growing prompts — 521K input tokens on the default task, 12× its final context. Cost grows with the square of the step count, so doubling the steps more than doubles the bill.
Q · 03 How much does prompt caching save on agent tasks? +
On the default task, 61%–79% across the 14 models with a cached-input rate. Claude Opus 5.5 drops from $2.56 to $0.767 per task. The longer the run, the bigger the saving, because more of each prompt is history the model has already seen.
Q · 04 What is the cheapest model for AI agents? +
On the default task: Claude Haiku 5.5 and GPT-6 Luna at $0.022 per task; the frontier end is GPT-6 Astra at $2.16 — 100× apart. Price per task isn't the whole story: a model that needs more steps or more retries can cost more than a pricier one that finishes first.
Q · 05 How many tokens does an AI agent use per task? +
It's dominated by re-sent context. The default task — 20 steps, 8K tokens to start, 1.9K added per step — sends 521K input tokens and produces 24K output tokens including reasoning. At 40 steps the input passes 1.8M.
Q · 06 How much does a Claude agent task cost? +
On the default task with caching: Claude Haiku 5.5 $0.022, Claude Sonnet 5.5 $0.384, Claude Opus 5.5 $0.767 per task. Anthropic charges $5.00/1M to write the cache on Claude Opus 5.5 and $0.20/1M to read it, against $4.00/1M for plain input.
Q · 07 Does the context window limit what an agent can do? +
Yes — the conversation must fit. Grok 4.7 has the smallest window in this lineup at 500K tokens; most others hold about 1M. When a run outgrows the window the agent has to compact its history, which costs extra calls and can lose detail. The calculator marks models that can't hold the final context.
Q · 08 How can I cut AI agent costs? +
In order of impact: turn on prompt caching and keep the system prompt stable so it stays cached; trim tool output before it enters the conversation (return the rows you need, not the whole page); cap steps and compact history on long runs; route easy sub-steps to a smaller model; and measure retries — a model that fails less can be cheaper per finished task.
Embed

Put this calculator on your site

Free to embed — your readers always see current rates. The widget links back here for the full tables.

<iframe
  src="https://aicost.tools/calculator/agent-cost/embed/"
  width="100%" height="960" loading="lazy"
  style="border:1px solid #3d3a32"
  title="AI Agent Cost Calculator by AI//COST">
</iframe>
More calculators

The cost toolbox

Every tool runs on the same live-pricing backbone. See the full index →

One weekly digest. Zero noise.

One weekly digest · No spam, ever · Unsubscribe in one click