Agent Cost Calculator

What does an agent loop actually cost?

Multi-step agents resend their full history on every step, so cost grows quadratically with step count, not linearly — a single-turn chat calculator will badly underestimate this. Model the real shape instead.

Start from
Cheapest for this loop
Qwen3.7 Flash
$29.99 /mo
#Model$/taskRelative$/month
1
QwenQwen3.7 Flash
$0.0060
$29.99
2
DeepSeekDeepSeek V4 Flash 0731
$0.0062
$31.08
3
DeepSeekDeepSeek V4.1 Flash
$0.0081
$40.27
4
AnthropicClaude Haiku 5.5 (batch)
$0.0102
$50.86
5
OpenAIGPT-6 Luna (batch)
$0.0102
$50.86
6
OpenAIGPT-6 Luna Pro (batch)
$0.0102
$50.86
7
GLM 5.3 Flash (batch)
$0.0117
$58.39
8
QwenQwen3.5-Flash
$0.0129
$64.40
9
GLM 4.7 Flash
$0.0129
$64.56
10
MistralMistral Small 4 (batch)
$0.0149
$74.30
11
DeepSeekDeepSeek V4 Flash 0423
$0.0171
$85.35
12
GoogleGemma 4 26B A4B
$0.0175
$87.58
13
QwenQwen3.5-9B
$0.0185
$92.46
14
AnthropicClaude Haiku 5.5
$0.0203
$102
15
OpenAIGPT-6 Luna
$0.0203
$102
16
OpenAIGPT-6 Luna Pro
$0.0203
$102
17
OpenAIGPT-5.6 Luna (batch)
$0.0209
$104
18
OpenAIGPT-5.6 Luna Pro (batch)
$0.0209
$104
19
OpenAIGPT-5.4 Nano (batch)
$0.0210
$105
20
DeepSeekDeepSeek V4.1 Flash (batch)
$0.0216
$108
21
QwenQwen3 Coder Next
$0.0255
$127
22
GoogleGemini 3.1 Flash Lite (batch)
$0.0261
$130
23
QwenQwen3.8 Flash
$0.0290
$145
24
QwenQwen3.8 Omni Flash
$0.0290
$145
25
GLM 5.3 Flash
$0.0292
$146
26
MistralMistral Small 4
$0.0297
$149
27
GLM 5.3
$0.0307
$153
28
QwenQwen3.5-35B-A3B
$0.0318
$159
29
QwenQwen3.6 35B A3B
$0.0318
$159
30
GoogleGemini 3.5 Flash Lite (batch)
$0.0332
$166
31
GoogleGemma 4 31B
$0.0375
$188
32
QwenQwen3.6 Flash
$0.0392
$196
33
GLM 5.2
$0.0405
$203
34
DeepSeekDeepSeek V4 Flash Vision Exp
$0.0417
$208
35
OpenAIGPT-5.6 Luna
$0.0417
$209
36
OpenAIGPT-5.6 Luna Pro
$0.0417
$209
37
OpenAIGPT-5.4 Nano
$0.0420
$210
38
GoogleGemini 3.1 Flash Lite
$0.0522
$261
39
GoogleGemini 3.1 Flash Lite Preview
$0.0522
$261
40
QwenQwen3.8 27B
$0.0541
$271
41
QwenQwen3.5 Plus 2026-02-15
$0.0543
$271
42
QwenQwen3.5-122B-A10B
$0.0570
$285
43
QwenQwen3.5-27B
$0.0598
$299
44
Command A+
$0.0610
$305
45
QwenQwen3.5 Plus 2026-04-20
$0.0626
$313
46
QwenQwen3.7 Plus
$0.0634
$317
47
GoogleGemini 3.5 Flash Lite
$0.0663
$332
48
QwenQwen3.6 Plus
$0.0678
$339
49
GLM 5.3 FlashX
$0.0721
$360
50
QwenQwen3.6 27B
$0.0736
$368
51
GoogleGemini 3.6 Flash (batch)
$0.0763
$381
52
GoogleGemini 3.7 Flash (batch)
$0.0763
$381
53
GoogleGemini 3.8 Flash (batch)
$0.0763
$381
54
OpenAIGPT-5.4 Mini (batch)
$0.0783
$391
55
GLM 5.3 (batch)
$0.0902
$451
56
MoonshotKimi K2.5
$0.1017
$509
57
QwenQwen3.5 397B A17B
$0.1075
$538
58
DeepSeekDeepSeek V4 Pro 0813
$0.1273
$636
59
MistralMistral Large 4
$0.1314
$657
60
MoonshotKimi K2.6
$0.1331
$665
61
MoonshotKimi K2.7 Code
$0.1365
$682
62
GoogleGemini 3.6 Flash
$0.1526
$763
63
GoogleGemini 3.7 Flash
$0.1526
$763
64
GoogleGemini 3.8 Flash
$0.1526
$763
65
MistralMistral Medium 3.5 (batch)
$0.1526
$763
66
GoogleGemini 3.5 Flash (batch)
$0.1565
$783
67
OpenAIGPT-5.4 Mini
$0.1565
$783
68
MoonshotKimi K3
$0.1589
$795
69
DeepSeekDeepSeek V4 Pro 0423
$0.1791
$896
70
GLM 5.1
$0.1870
$935
71
Grok 4.3 (batch)
$0.1876
$938
72
Grok Build 0.1
$0.1876
$938
73
GLM 5
$0.1939
$970
74
AnthropicClaude Sonnet 5 (batch)
$0.2034
$1,017
75
AnthropicClaude Sonnet 5.5 (batch)
$0.2034
$1,017
76
GoogleGemini 4 Argon (batch)
$0.2034
$1,017
77
OpenAIGPT-6 Sol (batch)
$0.2034
$1,017
78
OpenAIGPT-6 Sol Pro (batch)
$0.2034
$1,017
79
OpenAIGPT-6.1 Sol (batch)
$0.2034
$1,017
80
OpenAIGPT-6.1 Sol Pro (batch)
$0.2034
$1,017
81
GoogleGemini 3.1 Pro Preview (batch)
$0.2087
$1,044
82
OpenAIGPT-5.6 Terra (batch)
$0.2087
$1,044
83
OpenAIGPT-5.6 Terra Pro (batch)
$0.2087
$1,044
84
GLM 5 Turbo
$0.2335
$1,168
85
GLM 5V Turbo
$0.2335
$1,168
86
Grok 4.20
$0.2345
$1,172
87
Grok 4.20 Multi-Agent
$0.2345
$1,172
88
Grok 4.3
$0.2345
$1,172
89
OpenAIGPT-5.4 (batch)
$0.2609
$1,304
90
QwenQwen3.7 Max
$0.2845
$1,422
91
AnthropicClaude Sonnet 4.6 (batch)
$0.3051
$1,526
92
GoogleNano Banana 2.1
$0.3051
$1,526
93
MistralMistral Medium 3.5
$0.3051
$1,526
94
GoogleGemini 3.5 Flash
$0.3131
$1,565
95
OpenAIGPT-5.2-Codex
$0.3838
$1,919
96
OpenAIGPT-5.3-Codex
$0.3838
$1,919
97
QwenQwen3.8 2.4T A95B
$0.3857
$1,929
98
QwenQwen3.8 Max (0902)
$0.3857
$1,929
99
Grok 4.5
$0.3857
$1,929
100
Grok 4.6
$0.3857
$1,929
101
Grok 4.7
$0.3857
$1,929
102
AnthropicClaude Opus 5.5 (batch)
$0.4069
$2,034
103
AnthropicClaude Sonnet 5
$0.4069
$2,034
104
AnthropicClaude Sonnet 5.5
$0.4069
$2,034
105
GoogleGemini 4 Argon
$0.4069
$2,034
106
OpenAIGPT-5.6 Sol (batch)
$0.4069
$2,034
107
OpenAIGPT-5.6 Sol Pro (batch)
$0.4069
$2,034
108
OpenAIGPT-6 Sol
$0.4069
$2,034
109
OpenAIGPT-6 Sol Pro
$0.4069
$2,034
110
OpenAIGPT-6.1 Sol
$0.4069
$2,034
111
OpenAIGPT-6.1 Sol Pro
$0.4069
$2,034
112
GoogleGemini 3.1 Pro Preview
$0.4174
$2,087
113
GoogleGemini 3.1 Pro Preview Custom Tools
$0.4174
$2,087
114
OpenAIGPT-5.6 Terra
$0.4174
$2,087
115
OpenAIGPT-5.6 Terra Pro
$0.4174
$2,087
116
MoonshotKimi K3 (batch)
$0.4638
$2,319
117
AnthropicClaude Opus 4.6 (batch)
$0.5086
$2,543
118
AnthropicClaude Opus 4.7 (batch)
$0.5086
$2,543
119
AnthropicClaude Opus 4.8 (batch)
$0.5086
$2,543
120
AnthropicClaude Opus 5 (batch)
$0.5086
$2,543
121
OpenAIGPT-5.4
$0.5218
$2,609
122
OpenAIGPT-5.5 (batch)
$0.5218
$2,609
123
GLM 5.3 Prime
$0.5421
$2,711
124
AnthropicClaude Sonnet 4.6
$0.6103
$3,051
125
QwenQwen3.8 Max Prime
$0.7714
$3,857
126
AnthropicClaude Opus 5.5
$0.8137
$4,069
127
OpenAIGPT-5.6 Sol
$0.8137
$4,069
128
OpenAIGPT-5.6 Sol Pro
$0.8137
$4,069
129
AnthropicClaude Fable 5 (batch)
$1.02
$5,086
130
AnthropicClaude Fable 5.1 (batch)
$1.02
$5,086
131
AnthropicClaude Opus 4.6
$1.02
$5,086
132
AnthropicClaude Opus 4.7
$1.02
$5,086
133
AnthropicClaude Opus 4.8
$1.02
$5,086
134
AnthropicClaude Opus 5
$1.02
$5,086
135
OpenAIGPT-6 Astra (batch)
$1.02
$5,086
136
OpenAIGPT-6 Astra Pro (batch)
$1.02
$5,086
137
OpenAIGPT Chat Latest
$1.04
$5,218
138
OpenAIGPT-5.5
$1.04
$5,218
139
AnthropicClaude Fable 5
$2.03
$10,172
140
AnthropicClaude Fable 5.1
$2.03
$10,172
141
OpenAIGPT-6 Astra
$2.03
$10,172
142
OpenAIGPT-6 Astra Pro
$2.03
$10,172
143
OpenAIGPT-5.4 Pro (batch)
$3.13
$15,654
144
OpenAIGPT-5.5 Pro (batch)
$3.13
$15,654
145
OpenAIGPT-5.4 Pro
$6.26
$31,308
146
OpenAIGPT-5.5 Pro
$6.26
$31,308

Assumes fixed context (system prompt + tool schema) is resent every step, plus accumulating history from prior steps — the real shape of a stateless chat-completions API loop. Retry overhead is applied as a flat multiplier on total cost.

Why agent costs grow quadratically, not linearly

Chat-completion APIs are stateless — every call resends the full conversation, not just the new part. In a tool-using agent loop, each step's response (and the tool's observation) gets appended to that history, so by step N you're resending everything from steps 1 through N-1 on top of the new content. If each step adds roughly T tokens of new context, total input tokens across N steps work out to approximately T × N(N+1)/2 — quadratic, not linear, growth. Double the step count and the token bill doesn't double, it roughly quadruples. This is the actual mechanism behind the commonly-cited "agents use 4-15x more tokens than chat" figures.

What the inputs mean

Fixed context is what's resent unchanged on every single step — your system prompt plus every tool's schema definition. Tool schemas aren't free: real-world measurements put the average around 700 tokens per tool definition, so an agent with a dozen tools can spend a meaningful chunk of its context budget before any real work happens. Context added per step is the growing part — the model's own response plus whatever the tool returned, both of which get resent on every subsequent step. Output tokens per step is only what the model actually generates each turn (billed at the output rate), which is typically smaller than the total context growth per step, since tool observations aren't LLM-generated but still count as input on the next call.

Why the presets differ so much

The four starting presets are grounded in real step-count data rather than round numbers: coding agents commonly run 12-30 steps per task (SWE-bench agent trajectories average in that range), while a simple lookup-and-answer loop might resolve in 3-4. Because cost grows with the square of step count, that difference matters far more than it looks — a coding agent isn't just "4x more steps" expensive than a simple loop, it's closer to 15-20x on the input-token side alone.

What this doesn't model

This is a planning estimate, not a trace replay: real agents don't take a fixed number of steps every time, context isn't always a clean linear accumulation (some frameworks prune or summarize older history), and retry behavior varies a lot by task. Use the retry-overhead slider to sanity-check a range rather than treating the output as exact. For a single-turn (non-agentic) estimate, use the regular calculator instead.

Frequently asked questions

Why does cost grow quadratically instead of linearly with step count?
Because chat-completion APIs are stateless and resend the full conversation on every call. By step N, you're resending everything accumulated from steps 1 through N-1, so total input tokens scale roughly with the square of the step count, not the step count itself.
How much context do tool definitions actually cost?
Real measurements of MCP servers found tool-schema overhead averaging around 700 tokens per tool, with some heavier tools running 1,000+ tokens each — in tool-heavy setups this can consume 30-50% of the context budget before any real work happens.
Is this the same as the regular calculator?
No. The regular calculator models single-turn chat (one request, one response). This models a multi-step agent loop where each step resends the accumulating history, which produces a very different — and much larger — cost shape for the same nominal traffic volume.
Why include a retry/failure overhead slider?
Agent tasks fail and retry more often than single-turn chat calls — tool-call errors, rate limits, and multi-step reasoning failures all add real, billed tokens that a naive per-task estimate misses. The slider applies that as a flat percentage on top of the modeled cost so you can see a realistic range.