CheckPre

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

Model

Each request

Count text inCount text in
tokens

System prompt, conversation history, documents and tool definitions are all resent on every call.

tokens

The visible answer.

Count tokens from a prompt or JSON payloadShow

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.

tokens

Thinking tokens are billed as output. Leave at 0 for models or settings that do not reason.

Volume

PricePrice

12,000 requests over 30 days.

Discounts

%
0%100%

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.

Batch APIBatch API
Monthly cost$1,634$0.136 a request on Claude Opus 5.5
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
Output66%
  • Input26%
  • Cached input7%
  • Output66%
Every model on this workload, per month60,000 tokens in (85% cached), 4,500 out, 400 a day. Hover or focus a row for rates.
  1. 1Claude Haiku 5.5Anthropic$43.92
  2. 2GPT-6 LunaOpenAI$43.92
  3. 3GPT-5.6 LunaOpenAI$98.64
  4. 4DeepSeek V4.1 FlashDeepSeek$100.87
  5. 5Qwen3.8 FlashAlibaba$133.38
  6. 6Qwen3.7 PlusAlibaba$154.08
  7. 7Gemini 3.5 Flash-LiteGoogle$185.76
  8. 8Gemini 3.8 FlashGoogle$329.40
  9. 9DeepSeek V4 ProDeepSeek$383.33
  10. 10Grok 4.3xAI$392.40
  11. 11Claude Haiku 4.5Anthropic$439.20
  12. 12Claude Sonnet 5.5Anthropic$817.20
  13. 13GPT-6.1 SolOpenAI$817.20
  14. 14Grok 4.7xAI$846.00
  15. 15Claude Sonnet 5Anthropic$878.40
  16. 16GPT-6 SolOpenAI$878.40
  17. 17GPT-5.6 TerraOpenAI$986.40
  18. 18Gemini 3.1 ProGoogle$986.40
  19. 19Claude Opus 5.5Anthropic$1,634
  20. 20GPT-5.6 SolOpenAI$1,757
  21. 21Qwen3.8 MaxAlibaba$1,764
  22. 22Claude Opus 5Anthropic$2,196
  23. 23Claude Fable 5.1Anthropic$3,933
  24. 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,000

This 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.

  1. 1Each request: 60,000 input tokens (85% cached), 1,500 output and 3,000 reasoning
  2. 2Input costs $0.0462 and output $0.09, so $0.136 a request
  3. 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

Related calculators

More in AI, Cloud & Developer