A 50-step AI coding agent costs about 48¢ per task at the median of the 326 models I track, based on my modeled scenario at list prices as of 2026-10-11. The range is wide: GPT-6 Luna comes in at 4.1¢ per task and Claude Opus 5.5 at $1.68. Across 1,000 tasks, that is $40.71 versus $1,683.28.
What I modeled
My agent scenario starts with an 8,000-token system prompt. The agent runs 50 steps, adds 1,500 tokens of context per step, and produces 300 visible output tokens per step. Reasoning tokens are billed as output tokens, so they count toward the cost.
This is a modeled result, not a measured one. The inputs are fixed, so differences come from price per token, how each tokenizer counts text, and how many reasoning tokens each model uses. See the methodology for how modeled and measured results differ.
| # | Model | Cost per task | WebDev score | Tokens in / out | Basis | |
|---|---|---|---|---|---|---|
| 1 | DeepSeek V4.1 FlashDeepSeek | 2.4¢$24.06 / 1,000 | 1618 | 2,235,262 / 102,435 | modeled best value | |
| 2 | GLM 5.3 FlashZ.ai | 2.6¢$25.63 / 1,000 | 1606 | 2,239,737 / 43,814 | modeled | |
| 3 | GPT-6 LunaOpenAI | 4.1¢$40.71 / 1,000 | 1578 | 2,237,500 / 22,000 | modeled | |
| 4 | MiMo-V2.6-ProXiaomi | 6.5¢$64.51 / 1,000 | 1625 | 2,241,975 / 24,380 | modeled best value | |
| 5 | Claude Haiku 5.5Anthropic | 6.6¢$66.35 / 1,000 | 1585 | 3,101,175 / 50,340 | modeled | |
| 6 | GPT-5.4 NanoOpenAI | 8.7¢$86.92 / 1,000 | 1401 | 2,237,500 / 22,000 | modeled | |
| 7 | Qwen3.8 FlashAlibaba Qwen | 9.2¢$92.31 / 1,000 | - | 2,259,875 / 96,000 | modeled | |
| 8 | Mistral Small 4Mistral | 13¢$135 / 1,000 | - | 2,304,625 / 147,800 | modeled |
The spread across models
The cheapest models in this scenario are small, low-priced options:
- GPT-6 Luna: 4.1¢ per task ($40.71 per 1,000)
- MiMo-V2.6-Pro: 6.5¢ per task ($64.51 per 1,000)
- Claude Haiku 5.5: 6.6¢ per task ($66.35 per 1,000)
- GPT-5.4 Nano: 8.7¢ per task ($86.92 per 1,000)
The most expensive are frontier tiers:
- Claude Opus 5.5: $1.68 per task ($1,683.28 per 1,000)
- Claude Fable 5.1: $3.46 per task ($3,461.14 per 1,000)
- Kimi K3: $3.48 per task ($3,476.01 per 1,000)
- GPT-6 Astra: $3.72 per task ($3,721.00 per 1,000)
The table below shows how cost, input volume and reasoning volume line up for selected models.
| Model | Cost per task | Cost per 1,000 tasks | Input tokens | Output tokens | Reasoning tokens |
|---|---|---|---|---|---|
| GPT-6 Luna | 4.1¢ | $40.71 | 2,237,500 | 15,000 | 7,000 |
| Claude Haiku 5.5 | 6.6¢ | $66.35 | 3,101,175 | 20,790 | 29,550 |
| Qwen3.8 Flash | 9.2¢ | $92.31 | 2,259,875 | 15,150 | 80,850 |
| Claude Sonnet 5.5 | 84¢ | $841.64 | 3,101,175 | 20,790 | 10,900 |
| Claude Opus 5.5 | $1.68 | $1,683.28 | 3,101,175 | 20,790 | 10,900 |
| Claude Fable 5.1 | $3.46 | $3,461.14 | 3,101,175 | 20,790 | 10,900 |
Every row is modeled. Most models carry about 2.2 million input tokens; the Claude models carry about 3.1 million.
Context growth is the main driver
An agent resends its growing context on every step, so input tokens dominate the token count. A run carries roughly 2.2 to 3.1 million input tokens, far more than 300 visible output tokens per step would suggest.
Tokenizers add a multiplier. For the same English document, Anthropic models produce about 1.39 times the tokens of OpenAI models (OpenAI = 1.00). That is why the Claude runs show 3,101,175 input tokens while GPT-6 Luna shows 2,237,500 for the same loop.
Ways to limit context growth:
- Trim the system prompt. Every step pays for it again.
- Summarize or drop old tool outputs instead of keeping every result in the window.
- Use fewer steps when a task can be solved in fewer.
Caching changes the bill
Prompt caching is the second major lever. Cached input is priced far below fresh input, and the modeled costs above assume it. Without caching, the same runs cost much more:
| Model | With caching | Without caching |
|---|---|---|
| GPT-6 Luna | 4.1¢ | $0.23 |
| Claude Sonnet 5.5 | 84¢ | $6.52 |
| Claude Opus 5.5 | $1.68 | $13.04 |
Claude Opus 5.5 lists at $4.00 per 1M input tokens and $0.20 per 1M cached input tokens. Whether your framework and provider actually hit the cache decides which column you pay, so check cache hit rates in production before trusting a per-task estimate.
Reasoning tokens
Reasoning tokens add cost even when visible output is short. Qwen3.8 Flash uses 80,850 reasoning tokens in this scenario, and Mistral Small 4 and Mistral Large 4 each use 132,350. Because reasoning is billed as output, a low input price does not guarantee a cheap run.
Claude Haiku 5.5 shows the other side. It uses 29,550 reasoning tokens and still lands at 6.6¢ per task, because its prices are low enough to absorb the extra volume.
Code review and SQL follow the same pattern
For reviewing 500 lines of code, the median across models is 1.4¢. GPT-6 Luna runs at 0.31¢ ($3.08 per 1,000), Claude Sonnet 5.5 at 8.0¢, Claude Opus 5.5 at 16¢ and Claude Fable 5.1 at 40¢.
For writing a SQL query, the median is 0.23¢. GPT-6 Luna runs at 0.04¢ ($0.40 per 1,000), Claude Opus 5.5 at 2.2¢ and Claude Fable 5.1 at 5.5¢.
Basis matters. Twelve models are measured: Claude Haiku 5.5, Claude Sonnet 5.5, DeepSeek V4.1 Flash, Gemini 3.1 Pro Preview, Gemini 3.8 Flash, MiniMax M3, Mistral Large 4, GPT-6 Luna, GPT-6.1 Sol, Qwen3.8 Flash, Grok 4.7 and GLM 5.3 Flash. Each ran once per task with default settings via OpenRouter, with output capped at 16,000 tokens. Claude Opus 5.5 and Claude Fable 5.1 figures are estimates. In code review, Qwen3.8 Flash, GLM 5.3 Flash and DeepSeek V4.1 Flash hit the 16,000-token cap, spending it all on reasoning and returning almost no visible output.
What to do with these numbers
- Set a per-task budget, then test it against your own step count and context size in the calculator.
- Compare candidates on the agent task page and the code review page, and check model pages such as Claude Opus 5.5.
- Watch news and plans if you expect prices to change.
FAQ
How much does an AI coding agent cost per task?
In my modeled 50-step scenario, the median across 326 models is about 48¢ per task. Costs run from 4.1¢ for GPT-6 Luna to $3.72 for GPT-6 Astra at list prices as of 2026-10-11.
What makes an AI coding agent expensive?
Input tokens dominate because the agent resends its growing context at every step. Reasoning tokens, billed as output, and tokenizer differences add more on top.
Does prompt caching really matter for agent costs?
Yes. GPT-6 Luna costs 4.1¢ per task with caching and $0.23 without. Claude Opus 5.5 costs $1.68 with caching and $13.04 without, so cache hit rates strongly affect your real bill.