AI Agent Cost Calculator

Model true multi-step LLM agent spend before deployment—accounting for growing context per step, prompt caching, retries, task success rate, external APIs, and model routing.

Pricing verified 2026-11-12 View formulas & methodology Compare 8 agent frameworks

Runs 100% in your browser. Zero inputs stored or sent.

Per Successful Task $0.0136
Monthly Spend $203.43

Basics

Advanced (Caching, Retries, Routing & Variance)
Cost / Attempt $0.0125 LLM $0.0065 + API $0.0060
Cost / Successful Task $0.0136 P50 at 92% success
Daily Budget $6.781 500 tasks/day
Monthly / Annual $203.43 $2,475 / yr
Peak context: 7,550 tokens Fits inside GPT-5 mini (400,000)
Cheapest model that fits: GPT-5 nano ($118.95/mo)

Cumulative & Per-Step LLM Cost

Bars: step cost (incl. retries) · Line: cumulative LLM cost
$0.0065$0.0043$0.0022$0.0000Step 1: $0.0011 step / $0.0011 cumulativeStep 2: $0.0012 step / $0.0023 cumulativeStep 3: $0.0013 step / $0.0036 cumulativeStep 4: $0.0014 step / $0.0050 cumulativeStep 5: $0.0015 step / $0.0065 cumulativeS1S2S3S4S5

Per-Step Token & Cost Breakdown

Step Input Cached Output Step Cost Cumulative
Step 1 3,600 2,520 350 $0.0011 $0.0011
Step 2 4,500 3,150 350 $0.0012 $0.0023
Step 3 5,400 3,780 350 $0.0013 $0.0036
Step 4 6,300 4,410 350 $0.0014 $0.0050
Step 5 7,200 5,040 350 $0.0015 $0.0065

All Verified Models Compared (Sorted by Monthly Cost)

Single-model comparison using your current token, caching, retry, and success assumptions. Prices verified 2026-11-12 · Methodology & formulas

Model Provider In / 1M Cached / 1M Out / 1M Context Fit Cost / Success Monthly Source
GPT-5 nano Cheapest fit OpenAI $0.05 $0.005 $0.40 400,000 Fits $0.0079 $118.95 Official pricing
Claude Haiku 5.5 Anthropic $0.10 $0.01 $0.50 200,000 Fits $0.0087 $130.82 Official pricing
GPT-4.1 nano OpenAI $0.10 $0.025 $0.40 1,047,576 Fits $0.0088 $132.74 Official pricing
GPT-4o mini OpenAI $0.15 $0.075 $0.60 128,000 Fits $0.0108 $162.67 Official pricing
DeepSeek V4.1 Flash (Together) Together AI $0.30 $0.006 $1.20 1,048,576 Fits $0.0120 $179.59 Official pricing
DeepSeek V4.1 Flash (Fireworks) Fireworks AI $0.30 $0.006 $1.20 1,048,576 Fits $0.0120 $179.59 Official pricing
GPT-OSS 120B (Groq) Groq $0.15 Not published $0.60 131,072 Fits $0.0125 $187.63 Official pricing
GPT-5 mini Selected OpenAI $0.25 $0.025 $2.00 400,000 Fits $0.0136 $203.43 Official pricing
Gemini 3.5 Flash-Lite Google $0.30 $0.03 $2.50 1,048,576 Fits $0.0152 $227.64 Official pricing
Gemini 2.5 Flash Google $0.30 $0.03 $2.50 1,048,576 Fits $0.0152 $227.64 Official pricing
GPT-4.1 mini OpenAI $0.40 $0.1 $1.60 1,047,576 Fits $0.0158 $237.46 Official pricing
Gemini 3.8 Flash Google $0.75 $0.075 $3.75 1,048,576 Fits $0.0230 $345.32 Official pricing
Llama 3.3 70B Versatile (Groq) Groq $0.59 Not published $0.79 128,000 Fits $0.0268 $402.68 Official pricing
Claude Haiku 4.5 Anthropic $1.00 $0.1 $5.00 200,000 Fits $0.0285 $427.81 Official pricing
o4-mini (Reasoning) OpenAI $1.10 $0.275 $4.40 200,000 Fits $0.0321 $481.83 Official pricing
Llama 3.3 70B Instruct Turbo (Together) Together AI $0.88 Not published $0.88 131,072 Fits $0.0362 $543.33 Official pricing
Gemini 4 Hydrogen Google $1.50 $0.075 $7.50 1,048,576 Fits $0.0379 $567.85 Official pricing
GPT-5 OpenAI $1.25 $0.125 $10.00 400,000 Fits $0.0417 $625.87 Official pricing
Gemini 2.5 Pro Google $1.25 $0.125 $10.00 1,048,576 Fits $0.0417 $625.87 Official pricing
Qwen 3.8 Max (Fireworks) Fireworks AI $2.00 $0.25 $6.00 1,000,000 Fits $0.0434 $651.18 Official pricing
Claude Sonnet 5.5 Anthropic $2.00 $0.1 $10.00 1,000,000 Fits $0.0483 $724.52 Official pricing
GPT-4.1 OpenAI $2.00 $0.5 $8.00 1,047,576 Fits $0.0531 $796.01 Official pricing
o3 (Reasoning) OpenAI $2.00 $0.5 $8.00 200,000 Fits $0.0531 $796.01 Official pricing
Claude Sonnet 4.6 Anthropic $3.00 $0.3 $15.00 1,000,000 Fits $0.0725 $1,088 Official pricing
GPT-4o OpenAI $2.50 $1.25 $10.00 128,000 Fits $0.0786 $1,179 Official pricing
Claude Opus 5.5 Anthropic $4.00 $0.2 $20.00 1,000,000 Fits $0.0901 $1,351 Official pricing
Claude Opus 4.6 Anthropic $5.00 $0.5 $25.00 1,000,000 Fits $0.117 $1,748 Official pricing
Need a model added or spotted a pricing update? Email contact@aiagentsarena.com View 11-step calculation logic →

How This Multi-Step Agent Cost Model Works

Estimating an AI agent budget by multiplying a single prompt by an average token price almost always undercounts real production bills by 3x to 8x. Unlike a single-turn chat completion, an autonomous or semi-autonomous agent operates inside an iterative loop: it reads instructions and tool schemas, chooses a tool, ingests the returned payload, and calls the model again until the task completes or hits a stop condition.

Because stateless LLM APIs do not hold conversation memory on your behalf between turns, your orchestrator resends the base context plus every preceding step's tool output on step two, step three, and beyond. Read our full breakdown in How AI Agent Costs Work to see how step count dominates total spend, or jump straight to How to Reduce AI Agent Costs for practical optimization tactics.

Core Multi-Step Cost Model
4-Stage Summary
  1. Base Context sent on every step
    System Prompt + Tool Definitions + User Task
  2. Step i Input Tokens accumulates tool results
    Base Context + (i − 1) × Tool-Result Tokens Added per Step
  3. LLM Cost (with Retries) summed across steps
    (Σ Step Cost(i)) × (1 + Retry Rate)
  4. Budgeted Cost per Successful Task 1.00 P50 · 1.35 P90
    ((LLM Cost + External API Cost) / Success Rate) × Variance Multiplier
Includes caching, unpublished cache fallbacks, and model routing blend. See all 11 exact equations →

Worked Example: 5-Step Production Workflow

Using the default General Workflow settings loaded above on GPT-5 mini ($0.25/1M input, $0.025/1M cached input, $2.00/1M output), assume your agent loads a 1,800-token system prompt, 1,200 tokens of tool JSON schemas, and a 600-token user request. That yields a 3,600-token base context at Step 1.

Each tool call appends 900 tokens of structured results to the conversation history, so Step 2 sends 4,500 input tokens, Step 3 sends 5,400 tokens, Step 4 sends 6,300 tokens, and Step 5 sends 7,200 tokens—a peak context of 7,550 tokens (including 350 output tokens) and 27,000 total input tokens across the 5 calls before retries. With 70% prompt cache hits, an 8% retry overhead, 3 external API calls at $0.002 each ($0.0060 total), and a 92% task success rate at 500 tasks per day, every number in the table above updates deterministically from the exact formula documented on our Cost Model & Methodology page.

Choosing the Right Specialized Calculator

Different agent workloads fail and scale in distinct ways. A high-volume support agent handles short tickets with high cache-hit ratios, while a coding agent replays large repository diffs over a dozen steps. Use our pre-configured workload calculators to start from realistic engineering baselines:

  • Customer Support Agent Cost Calculator: Models 2,500 daily tickets, 80% prompt caching across static policy docs, and ticket escalation rates.
  • Research Agent Cost Calculator: Models 10-step search and synthesis loops, heavy retrieval payloads, paid search API calls, and P90 variance reserves.
  • Coding Agent Cost Calculator: Models 12-step repo inspection, test-failure retries, model routing to economy models, and larger code diffs.
  • Agent Framework Picker: Answer 8 engineering questions to compare LangGraph, CrewAI, Microsoft Agent Framework, OpenAI Agents SDK, Google ADK, Claude Agent SDK, LlamaIndex, and direct API loops.

Essential Cost & Architecture Reading

Before locking in a model contract or orchestration stack, review how tokenization interacts with context window thresholds in Tokens and Context Windows Explained. If you are planning machine-to-machine paid tool calls, see our technical breakdown of the x402 payment protocol for AI agents, or examine how US enterprises govern production agents in 12 Real Agentic AI Examples Across US Industries.

Frequently Asked Questions

Why do AI agent costs grow much faster than single-turn chat prompts?

In a multi-step agent loop, every LLM call resends the system prompt, all tool JSON schemas, the user prompt, and the accumulated history of earlier tool results. Over 5 to 12 steps, total billed input tokens scale quadratically rather than linearly.

How does prompt caching affect multi-step agent bills?

When a provider supports prompt caching, repeated static prefixes—such as your system prompt, tool definitions, and earlier conversation turns—are billed at the cache-read rate (often 50% to 95% lower than standard input tokens).

Why does the calculator divide attempt cost by the task success rate?

Failed runs, stalled loops, and escalated tickets still consume LLM tokens and external API calls. Dividing total attempt cost by the task success rate gives the true unit cost per successfully completed task.

What is the difference between P50 and P90 budgeting?

P50 reflects the median expected trajectory using your average step count. P90 applies a 1.35x variance reserve to protect production budgets against long-tail tasks that require extra tool calls or retries.

Are any inputs sent to a server when I use this calculator?

No. All interactive updates, CSV exports, and shareable links run locally inside your browser. Default examples are server-rendered in PHP for speed and accessibility, and no inputs are logged or stored.