Free calculator · runs in your browser

AI agent cost calculator: per task and per month

Agents loop: think, call a tool, read the result, repeat. Every step re-sends a longer context. Estimate the bill per task and per month, then compare models.

At list prices checked 28 Oct 2026, an AI agent that takes 8 model calls per task, re-sends 4,000 tokens of instructions each time and adds 1,500 tokens of tool results per step uses about 76,400 tokens and costs about $0.088 per task on Claude Sonnet 5.5 (with 60% of input served from cache), or $0.0046 on Claude Haiku 5.5. At 50 tasks a day with 10% retried, that is about $147 a month on Claude Sonnet 5.5, $293 on Claude Opus 5.5 and $7.70 on Claude Haiku 5.5.

The agent

Monthly bill

$147

Tokens per task76,400
Cost per task$0.088
Runs per month (incl. retries)1,672
Total per month$147

Embed this calculator

Paste this into your page. The frame loads the calculator with the scenario currently in the link; free to use, with a visible link back to this site inside.

Current list prices (checked 15 Oct 2026)

USD per million tokens, standard (non-batch) API tier, before tax. "Cache read" is the price of input tokens served from a prompt cache. Each row shows when it was last checked on the provider's own pricing page.

ModelVendorInput $/MOutput $/MCache read $/MChecked
Claude Fable 5.1Anthropic$10$50$0.25
Claude Opus 5.5Anthropic$4$20$0.20
Claude Sonnet 5.5Anthropic$2$10$0.10
Claude Haiku 5.5Anthropic$0.10$0.50$0.01
GPT-6 AstraOpenAI$10$50$1
GPT-6.1 SolOpenAI$2$10$0.10
GPT-6 LunaOpenAI$0.10$0.50$0.01
Gemini 3.1 Pro (Preview)Google$2$12$0.20
Gemini 3.8 FlashGoogle$0.75$3.75$0.075
Gemini 3.5 Flash-LiteGoogle$0.30$2.50$0.03
Gemini 3.1 Flash-LiteGoogle$0.25$1.50$0.025
Notes and sources
  • Claude Fable 5.1: cache_write = 5-minute cache write; cache hits priced at 0.025x base input. 1M context at standard pricing. US-only inference (inference_geo) is 1.1x.
  • Claude Opus 5.5: cache_write = 5-minute cache write; cache hits priced at 0.05x base input. 1M context at standard pricing. Fast mode costs extra.
  • Claude Sonnet 5.5: cache_write = 5-minute cache write; cache hits priced at 0.05x base input. 1M context at standard pricing.
  • Claude Haiku 5.5: Batch prices are for prompts up to 100,000 tokens too (over: $0.25 in, $1.25 out). Prices are for prompts up to 100,000 tokens. Prompts over 100,000 tokens: input $0.50, output $2.50, cache read $0.05, 5m cache write $0.625, 1h cache write $1.
  • GPT-6 Astra: Standard tier, short context (<=272K input tokens). Long context (>272K): input $20, cached $2, cache write $25, output $75. Regional/data-residency endpoints +10%.
  • GPT-6.1 Sol: Standard tier, short context (<=272K input tokens). Long context (>272K): input $4, cached $0.20, cache write $5, output $15. Regional/data-residency endpoints +10%.
  • GPT-6 Luna: Standard tier, short context (<=272K input tokens). Long context (>272K): input $0.20, cached $0.02, cache write $0.25, output $0.75. Regional/data-residency endpoints +10%.
  • Gemini 3.1 Pro (Preview): Paid tier, prompts <=200k tokens. >200k: input $4, output $18, caching $0.40. Output includes thinking tokens. Cache storage $4.50 per 1M tokens per hour. Model is a preview.
  • Gemini 3.8 Flash: Paid tier. Prices valid through 2026-12-31. From 2027-01-01: input $1.50, output $7.50, caching $0.15, storage $1.00/1M tokens/hour. No separate long-context tier.
  • Gemini 3.5 Flash-Lite: Paid tier. Same price for text/image/video/audio. No separate long-context tier. The older Gemini 3.1 Flash-Lite costs less (see next entry).
  • Gemini 3.1 Flash-Lite: Paid tier, text/image/video prices. Audio input $0.50, audio caching $0.05.

Sources: platform.claude.com, developers.openai.com, ai.google.dev. Raw data: /data/prices.json.

The same agent on every model

ModelPer taskPer month
Claude Haiku 5.5 Anthropic$0.0046$7.70
GPT-6 Luna OpenAI$0.0046$7.70
Gemini 3.1 Flash-Lite Google$0.012$20.25
Gemini 3.5 Flash-Lite Google$0.016$27.11
Gemini 3.8 Flash Google$0.035$57.73
Claude Sonnet 5.5 Anthropic$0.088$147
GPT-6.1 Sol OpenAI$0.088$147
Gemini 3.1 Pro (Preview) Google$0.097$162
Claude Opus 5.5 Anthropic$0.175$293
Claude Fable 5.1 Anthropic$0.427$714
GPT-6 Astra OpenAI$0.46$770

How it works

Step n sends the instructions plus (n − 1) × the new context per step. Input for one task is the sum over all steps; output is steps × output per step. The cached share of input is billed at the cache-read price. Runs per month = tasks per day × 30.4 × (1 + retry share).

Real agents vary: some steps are tiny, some read whole files. Use the averages from your logs if you have them. The guide what an AI agent costs to run walks through this example and the levers that change it.

Questions

How much does an AI agent cost per task?

It depends on the steps and the context, not on the model alone. The default example here (8 steps, 4,000 tokens of instructions, 1,500 new tokens per step, 300 output tokens per step) is about 76,400 tokens: $0.088 on Claude Sonnet 5.5 with 60% cached input, $0.175 on Claude Opus 5.5 and $0.0046 on Claude Haiku 5.5. Change the inputs to match your logs.

Why does cost grow faster than the number of steps?

Each step re-sends the instructions plus everything that happened so far: earlier tool results and the model's own replies. With 8 steps and 1,500 new tokens per step, the last step sends over 10,000 extra tokens. Doubling the steps roughly quadruples the context part of the bill.

How do I make an agent cheaper?

Cache the fixed instructions, trim tool results before passing them back, cap the number of steps, and route simple steps to a cheaper model. Retries are expensive, so validate tool inputs before calling the model again.

Does this include tool costs?

No. Search APIs, browsers or code sandboxes your agent calls are billed separately by their providers.

Related guides

More calculators

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.