AI Coding Agent Cost Calculator
What an AI coding agent costs per task and per month, where every step resends a large context that mostly caches and the model thinks before it acts.
Updated · By Niraj Kumar · 6 sources
https://checkpre.com/ai/ai-coding-agent-cost-calculator
Model
Each request
System prompt, conversation history, documents and tool definitions are all resent on every call.
The visible answer.
Count tokens from a prompt or JSON payloadShowHide
Plain text, OpenAI Chat or Responses JSON, or Anthropic Messages JSON. A final assistant message or a response body counts as output. Counted in your browser; nothing is uploaded.
Loading the tokenizer…
Counts use OpenAI's o200k tokenizer, so they are exact for GPT-6 and GPT-5 models, plus a few tokens of message framing. Other providers' tokenizers count the same text differently and do not publish a conversion factor; Anthropic says Claude models from 4.7 on produce about 30% more tokens than earlier Claude models. For an exact count on another model, paste one of its API responses: the usage it reports is shown above.
Thinking tokens are billed as output. Leave at 0 for models or settings that do not reason.
Volume
12,000 requests over 30 days.
Discounts
The share of input that repeats exactly at the start of every request, such as a fixed system prompt. The prompt caching calculator prices cache writes and expiry in detail.
- Per 1,000 requests
- $136.20
- Input
- $432.00
- Cached input
- $122.40
- Output and reasoning
- $1,080
- Price rank
- 19th cheapest of 24
- Cheapest listed model
- Claude Haiku 5.5
- $43.92 a month, $1,590 less
- Input26%
- Cached input7%
- Output66%
- 1Claude Haiku 5.5Anthropic$43.92
- 2GPT-6 LunaOpenAI$43.92
- 3GPT-5.6 LunaOpenAI$98.64
- 4DeepSeek V4.1 FlashDeepSeek$100.87
- 5Qwen3.8 FlashAlibaba$133.38
- 6Qwen3.7 PlusAlibaba$154.08
- 7Gemini 3.5 Flash-LiteGoogle$185.76
- 8Gemini 3.8 FlashGoogle$329.40
- 9DeepSeek V4 ProDeepSeek$383.33
- 10Grok 4.3xAI$392.40
- 11Claude Haiku 4.5Anthropic$439.20
- 12Claude Sonnet 5.5Anthropic$817.20
- 13GPT-6.1 SolOpenAI$817.20
- 14Grok 4.7xAI$846.00
- 15Claude Sonnet 5Anthropic$878.40
- 16GPT-6 SolOpenAI$878.40
- 17GPT-5.6 TerraOpenAI$986.40
- 18Gemini 3.1 ProGoogle$986.40
- 19Claude Opus 5.5Anthropic$1,634
- 20GPT-5.6 SolOpenAI$1,757
- 21Qwen3.8 MaxAlibaba$1,764
- 22Claude Opus 5Anthropic$2,196
- 23Claude Fable 5.1Anthropic$3,933
- 24GPT-6 AstraOpenAI$4,392
How the AI Coding Agent Cost Calculator works
cost = (fresh input × input rate + cached input × cache rate + (output + reasoning) × output rate) ÷ 1,000,000This page uses the same method as the LLM API Cost Calculator, which explains each term and assumption in full.
Worked example
400 agent steps a day. Each step resends a growing context of files, tool definitions and earlier steps, about 60,000 tokens, most of it an unchanged prefix that caches. Each step writes 1,500 tokens of code or tool calls and thinks for about 3,000. Priced on Claude Opus 5.5.
- 1Each request: 60,000 input tokens (85% cached), 1,500 output and 3,000 reasoning
- 2Input costs $0.0462 and output $0.09, so $0.136 a request
- 3× 12,000 requests over 30 days = $1,634
$1,634 a month on Claude Opus 5.5. The cheapest listed model, Claude Haiku 5.5, would cost $43.92.
Frequently asked questions
Why do coding agents use so many tokens?
Each step of the loop sends the whole working context again: the task, tool definitions, file contents and every earlier step and tool result. A task of 30 steps with a 60,000-token context reads nearly two million input tokens. Caching that prefix is what keeps agents affordable, which is why the preset assumes 85% of input is cached.
How do reasoning tokens affect agent cost?
They are billed as output, the most expensive kind of token, and agents on hard tasks can think for thousands of tokens a step. Lowering the model's effort setting for routine steps cuts them sharply. Judge cost per finished task rather than per step: a cheaper model that needs more steps or retries is not cheaper.
Sources
- Anthropic, Claude API pricing · checked
- OpenAI, API pricing · checked
- Google, Gemini API pricing · checked
- DeepSeek, Models and pricing · checked
- xAI, Models and pricing · checked
- Alibaba Cloud Model Studio, Model pricing · checked
Related calculators
- LLM API Cost CalculatorPrice a real workload across Claude, GPT, Gemini, DeepSeek, Grok and Qwen side by side, with prompt caching, batch discounts and exact token counts.
- Prompt Caching ROI CalculatorSee whether caching your system prompt or documents pays off: cache writes, reads, expiry and break-even for Claude, GPT and Gemini.
- Claude Sonnet 5 vs Claude Opus 5.5 API CostClaude Opus 5.5 costs exactly twice Sonnet 5 per token, but the same $0.20 for a cache hit. Find out what stepping up to Opus would cost you.
More in AI, Cloud & Developer
- LLM Summarization Cost Calculator
- LLM Classification Cost Calculator
- Claude Sonnet 5 vs GPT-6 Sol API Cost
- Claude Sonnet 5 vs GPT-5.6 Terra API Cost
- Claude Sonnet 5 vs Gemini 3.1 Pro API Cost
- Claude Opus 5.5 vs GPT-6 Astra API Cost
- Claude Opus 5.5 vs GPT-5.6 Sol API Cost
- Claude Opus 5.5 vs Gemini 3.1 Pro API Cost
- All 99 AI, Cloud & Developer calculators