AI agent cost calculator

112 of 131 models match the official page, 107 match models.devSynced 2026-12-05 13:00 UTC · Method

Agents call the model many times per task, and each call re-reads everything so far. Enter your loop shape to see cost per task and per month.

Agent run cost per model
ModelProvider Per taskHeavy run (2× calls)Monthly

Agent runs vary: the same task can take twice the calls after retries and dead ends. Because the context grows with every call, twice the calls costs about three to four times as much. Every current text model is ranked (129); 2 evaluation-only models (no text output) are left out, so this list has 2 fewer than the 131 in the price table.

Coding tools on an API key: Claude Code, Codex, Cursor

Coding tools run agent loops: every step resends the conversation, file contents and tool results. When a tool bills per API token, a session costs the model's API price times those tokens, so the calculator above applies. Subscription plans are billed differently and are not compared here; the monthly API credits in Claude Max and Ultra do not cover Claude Code, and the API credits in ChatGPT Pro and Business do not cover Codex, whether used with an API key or signed in (signed-in Codex counts against the plan's usage limits) (subscriptions vs API). GitHub Copilot bills Chat, CLI and cloud agent use in GitHub AI Credits (1 credit = $0.01) at per-token model rates. When checked on 2026-12-02, its rates for OpenAI and Anthropic models listed both there and here, other than GPT-5.6 Sol, matched the direct API prices, except that GPT-5.6 Luna's long-context rate starts above 200K input tokens in Copilot versus 272K on the API, so a cost from the calculator divided by $0.01 approximates the credits used before discounts (on paid plans: 10% with auto model selection in Chat or cloud agent; 30% with Copilot Fusion through 2026-12-31). GPT-5.6 Sol is the exception: Copilot charges less than the API (per 1M tokens: input $4, cached input $0.40, cache write $5, output $20; above 272K input tokens $8, $0.80, $10 and $30, versus $5, $0.50, $6.25 and $30, and $10, $1, $12.50 and $45 on the API), so this approximation does not hold for it; work out its credits from Copilot's rates instead. Code completions and next edit suggestions are not billed in credits on any plan and are unlimited on paid plans (GitHub docs).

Coding tools on an API key: Claude Code, Codex, Cursor
ToolHow API usage is billed (official docs)Source
Claude CodeCharged by API token consumption: per token through the Claude Console or a cloud provider (Amazon Bedrock, Google Cloud, Microsoft Foundry). Uses Anthropic (Claude) models.code.claude.com/docs/en/costs
CodexWith an API key, usage is charged at standard OpenAI API rates; the models available follow your key. Uses OpenAI models.learn.chatgpt.com/docs/pricing
CursorThird-party models (Claude, GPT, Gemini) are billed at the model's API list price from prepaid credit, on Premium and above.cursor.com/docs/models

Cost of one coding session by model (example)

Example assumption, not a measurement: 30 model calls per session, 15,000 starting tokens (instructions, tool definitions, files), +2,000 tokens per call, 400 output tokens per call, 90% of input read from the prompt cache, 5 sessions a day. That is 1,320,000 input and 12,000 output tokens per session; real sessions can be far smaller or larger. Load this example into the calculator and change it

Cost of one coding session by model (example)
ModelProviderInput /1MCached /1MOutput /1MPer sessionMonth (5/day)
Claude Haiku 5.5Anthropic$0.10$0.01$0.50$0.03$5.16/mo
Claude Sonnet 5.5Anthropic$2.00$0.10$10.00$0.57$85.32/mo
Claude Sonnet 5Anthropic$2.00$0.20$10.00$0.69$103/mo
Claude Sonnet 4.6Anthropic$3.00$0.30$15.00$1.03$155/mo
Claude Opus 5.5Anthropic$4.00$0.20$20.00$1.14$171/mo
Claude Opus 5Anthropic$5.00$0.50$25.00$1.72$258/mo
Claude Opus 4.8Anthropic$5.00$0.50$25.00$1.72$258/mo
Claude Opus 4.7Anthropic$5.00$0.50$25.00$1.72$258/mo
Claude Opus 4.6Anthropic$5.00$0.50$25.00$1.72$258/mo
Claude Fable 5.2Anthropic$8.00$0.20$40.00$2.04$306/mo
Claude Mythos 5.2Anthropic$8.00$0.20$40.00$2.04$306/mo
Claude Fable 5.1Anthropic$10.00$0.25$50.00$2.55$382/mo
Claude Mythos 5.1Anthropic$10.00$0.25$50.00$2.55$382/mo
Claude Mythos 5Anthropic$10.00$1.00$50.00$3.44$516/mo
Claude Fable 5Anthropic$10.00$1.00$50.00$3.44$516/mo
GPT-6 LunaOpenAI$0.10$0.01$0.50$0.03$5.16/mo
GPT-5.6 LunaOpenAI$0.20$0.02$1.20$0.07$10.67/mo
GPT-5.4 miniOpenAI$0.75$0.075$4.50$0.24$36.31/mo
GPT-6.1 TerraOpenAI$1.00$0.05$5.00$0.28$42.66/mo
GPT-6.2 SolOpenAI$2.00$0.10$10.00$0.57$85.32/mo
GPT-6.1 SolOpenAI$2.00$0.10$10.00$0.57$85.32/mo
GPT-5.2OpenAI$1.75$0.175$14.00$0.61$91.03/mo
GPT-6 SolOpenAI$2.00$0.20$10.00$0.69$103/mo
GPT-5.6 TerraOpenAI$2.00$0.20$12.00$0.71$107/mo
GPT-5.4OpenAI$2.50$0.25$15.00$0.81$121/mo
GPT-5.5OpenAI$5.00$0.50$30.00$1.61$242/mo
GPT-5.6 SolOpenAI$5.00$0.50$30.00$1.78$267/mo
GPT-6.2 AstraOpenAI$8.00$0.40$40.00$2.28$341/mo
GPT-6 AstraOpenAI$10.00$1.00$50.00$3.44$516/mo
GPT-5.2 Pro *OpenAI$21.00—$168.00$29.74$4,460/mo
GPT-5.5 Pro *OpenAI$30.00—$180.00$41.76$6,264/mo
GPT-5.4 Pro *OpenAI$30.00—$180.00$41.76$6,264/mo
Gemini 3.5 Flash LiteGoogle (Gemini)$0.30$0.03$2.50$0.11$15.79/mo
Gemini Flash Lite (latest)Google (Gemini)$0.30$0.03$2.50$0.11$15.79/mo
Gemini 3 Flash PreviewGoogle (Gemini)$0.50$0.05$3.00$0.16$24.21/mo
Gemini 3.8 FlashGoogle (Gemini)$0.75$0.075$3.75$0.23$34.96/mo
Gemini Flash (latest)Google (Gemini)$0.75$0.075$3.75$0.23$34.96/mo
Gemini 3.6 FlashGoogle (Gemini)$0.75$0.075$3.75$0.23$34.96/mo
Gemini 4 HydrogenGoogle (Gemini)$1.50$0.075$7.50$0.38$56.56/mo
Gemini 3.1 Pro PreviewGoogle (Gemini)$2.00$0.20$12.00$0.65$96.84/mo
Gemini Pro (latest)Google (Gemini)$2.00$0.20$12.00$0.65$96.84/mo
Gemini 4 NeonGoogle (Gemini)$3.00$0.15$15.00$0.75$113/mo
Gemini 4 CarbonGoogle (Gemini)$4.00$0.20$20.00$1.01$151/mo
Genie 4 *Google (Gemini)$1.50—$9.00$2.09$313/mo

* No cached-input price in our data, so all input is billed at the full rate. The other 10% of input is billed at the model's cache-write price where it has one (Claude, and OpenAI models that charge for cache writes; 1.25× input), else at the normal input price. Thinking tokens are billed as output: raise output per call if your model thinks a lot. A tool's own fees are not included. Estimates from published per-token rates; check official pricing before budgeting. Data synced from the LiteLLM price list 2026-12-05 13:00 UTC.

How it is calculated

Call i sends starting context + i × tokens added, so total input per task is calls × start + added × calls × (calls − 1) / 2. The cache-hit share is billed at the cached-input price; with caching on, the rest of the input is billed at the model's cache-write price where our data has one (shown on each model page), else at the normal input price. 30 days per month.

Running agents as n8n workflows? On top of tokens you pay the n8n Cloud plan, or your own server if you self-host: n8n Cloud vs self-hosted.

FAQ

Why do agents cost more than chatbots?

Each step resends the whole growing context: instructions, tool definitions and every previous tool result. Input tokens therefore grow roughly with the square of the number of steps.

How do I make agents cheaper?

Enable prompt caching for the stable prefix, trim or summarize old tool results, cap the number of steps, and route easy steps to a smaller model.

Do MCP servers and tools add to the token bill?

Yes. On the Claude API, the tools parameter (tool names, descriptions and schemas), tool_use blocks in requests and responses, and tool_result blocks all add billed tokens. A request with at least one tool in tools also adds a tool-use system prompt (286 tokens on Claude Opus 5.5 with tool_choice auto). With the MCP connector, the description of every enabled MCP tool is sent to the model; setting defer_loading (used with the tool search tool) only keeps it out at first. Allowlist only the tools you need. Server tools such as web search add usage charges on top. Claude tool use pricing