Executive Summary

The AI coding API market in 2026 spans an extraordinary price range. The cheapest model costs $0.075 per million input tokens (Gemini 1.5 Flash), while the most expensive costs $30.00 per million (GPT-4) — a 400x difference. For a typical medium project (500K input + 200K output tokens), costs range from under $0.10 to over $15.00.

Key findings from our analysis of 113 models across 20 providers:

  • Google offers the cheapest models — Gemini 1.5 Flash, 2.0 Flash, and 2.5 Flash are all under $0.15/M input tokens.
  • Reasoning capability is getting cheaper — o3-mini and DeepSeek Reasoner deliver advanced reasoning at $1.10/M and $0.55/M respectively.
  • Mid-range is the sweet spot — Claude Sonnet 4 ($3/M) and GPT-4o ($2.50/M) offer the best balance of quality and cost.
  • Chinese providers offer competitive pricing — DeepSeek and Qwen models match or beat Western pricing on comparable capability.

Cheapest Model Per Scenario

Which model wins for each project size?

Small Script (1K lines)

Cheapest: GLM-4-Flash$0.00
Most Expensive: OpenAI o3 Pro — $3.10
Savings with cheapest: 100% less

Medium Feature (10K lines)

Cheapest: GLM-4-Flash$0.01
Most Expensive: Claude Opus 4 — $23.29
Savings with cheapest: 100% less

Large Project (50K lines)

Cheapest: GLM-4-Flash$0.03
Most Expensive: Claude Opus 4 — $116.44
Savings with cheapest: 100% less

Code Review (5K lines)

Cheapest: GLM-4-Flash$0.00
Most Expensive: GPT-4 — $6.75
Savings with cheapest: 100% less

Provider Comparison

How the 20 AI providers stack up on average pricing.

ProviderModelsAvg InputAvg OutputCheapest ModelCheapest (Medium Project)
Anthropic 9 $4.65 $23.25 Claude 3 Haiku $0.34
OpenAI 17 $7.65 $26.45 GPT-4.1 Nano $0.12
Google 10 $0.569 $2.77 Gemini 2.5 Flash Lite $0.04
Qwen 13 $1.01 $4.20 Qwen Turbo $0.08
DeepSeek 8 $0.261 $1.02 DeepSeek V3 $0.11
Mistral 10 $0.920 $2.78 Mistral Small 3 $0.10
xAI 7 $2.69 $12.57 Grok 3 Mini $0.21
Meta 5 $0.220 $0.780 Llama 3.1 8B $0.04
Microsoft 4 $0.087 $0.250 Phi-3 Mini $0.04
Reka 3 $0.533 $1.43 Reka Flash $0.23
Amazon 4 $0.849 $4.02 Amazon Nova Micro $0.04
Cohere 3 $1.55 $6.20 Cohere Command R $0.17
01.ai 2 $1.32 $5.30 Yi-Lightning $0.17
Zhipu AI 4 $1.96 $1.96 GLM-4-Flash $0.01
MiniMax 2 $0.100 $0.400 MiniMax Text 01 $0.06
Perplexity 3 $3.00 $12.00 Perplexity Sonar $0.55
Stability AI 2 $0.075 $0.300 Stable Code 3B $0.06
Groq 3 $0.343 $0.410 Groq Gemma 2 9B $0.11
Databricks 2 $2.88 $8.63 Databricks DBRX Instruct $0.71
Together AI 2 $0.840 $0.840 Together Mistral Small 3 $0.44

Complete Price Ranking — All 113 Models

Ranked by medium project cost (500K input + 200K output tokens, 30% cache hit rate).

#ModelProviderSmallMediumLargeCode Review
1 GLM-4-Flash Zhipu AI <$0.01 $0.01 $0.03 <$0.01
2 Llama 3.1 8B Meta <$0.01 $0.04 $0.19 $0.01
3 Phi-3 Mini Microsoft <$0.01 $0.04 $0.19 $0.01
4 Amazon Nova Micro Amazon <$0.01 $0.04 $0.20 <$0.01
5 Gemini 2.5 Flash Lite Google <$0.01 $0.04 $0.22 $0.01
6 MiniMax Text 01 MiniMax <$0.01 $0.06 $0.29 $0.01
7 Stable Code 3B Stability AI <$0.01 $0.06 $0.29 $0.01
8 Amazon Nova Lite Amazon <$0.01 $0.07 $0.34 $0.02
9 Qwen Turbo Qwen $0.01 $0.08 $0.38 $0.02
10 GLM-4-Air Zhipu AI <$0.01 $0.08 $0.39 $0.03
11 Mistral Nemo Mistral <$0.01 $0.08 $0.41 $0.03
12 Pixtral 12B Mistral <$0.01 $0.08 $0.41 $0.03
13 Gemini 1.5 Flash Google $0.01 $0.09 $0.43 $0.02
14 Gemini 2.0 Flash Lite Google $0.01 $0.09 $0.43 $0.02
15 Mistral Small 3 Mistral $0.01 $0.10 $0.47 $0.02
16 Microsoft Phi-4 Microsoft $0.01 $0.10 $0.47 $0.02
17 Mistral Small 3 Mistral $0.01 $0.10 $0.47 $0.02
18 Phi-3 Medium Microsoft $0.01 $0.10 $0.47 $0.02
19 Phi-4 Mini Microsoft $0.01 $0.10 $0.47 $0.02
20 DeepSeek V3 DeepSeek $0.01 $0.11 $0.53 $0.03
21 Groq Gemma 2 9B Groq $0.01 $0.11 $0.55 $0.04
22 Gemini 2.0 Flash Google $0.02 $0.12 $0.58 $0.03
23 Gemma 3 27B Google $0.02 $0.12 $0.58 $0.03
24 Stable LM 2 Stability AI $0.02 $0.12 $0.58 $0.03
25 GPT-4.1 Nano OpenAI $0.02 $0.12 $0.58 $0.03
26 Groq Mixtral 8x7B Groq $0.02 $0.13 $0.66 $0.05
27 Qwen 2.5 Coder 32B Qwen $0.02 $0.15 $0.75 $0.04
28 Llama 3.1 70B Meta $0.02 $0.15 $0.75 $0.04
29 DeepSeek R1 DeepSeek $0.02 $0.16 $0.80 $0.04
30 Gemini 2.5 Flash Google $0.02 $0.17 $0.86 $0.04
31 Qwen 3 Turbo Qwen $0.02 $0.17 $0.86 $0.04
32 DeepSeek Jiuge DeepSeek $0.02 $0.17 $0.86 $0.04
33 Cohere Command R Cohere $0.02 $0.17 $0.86 $0.04
34 Yi-Lightning 01.ai $0.02 $0.17 $0.86 $0.04
35 MiniMax-M1 MiniMax $0.02 $0.17 $0.86 $0.04
36 Gemini 2.5 Flash Google $0.02 $0.17 $0.86 $0.04
37 GPT-4o mini OpenAI $0.02 $0.18 $0.92 $0.05
38 Grok 3 Mini xAI $0.03 $0.21 $1.02 $0.07
39 Reka Flash Reka $0.03 $0.23 $1.15 $0.06
40 Llama 4 Scout Meta $0.03 $0.23 $1.15 $0.06
41 Codestral Mistral $0.04 $0.29 $1.43 $0.07
42 Llama 3.3 70B Meta $0.04 $0.29 $1.44 $0.07
43 Qwen 2.5 72B Qwen $0.04 $0.30 $1.50 $0.09
44 DeepSeek Chat V3 DeepSeek $0.04 $0.31 $1.57 $0.07
45 DeepSeek Coder V2 DeepSeek $0.04 $0.31 $1.57 $0.07
46 DeepSeek Coder V3 DeepSeek $0.04 $0.31 $1.57 $0.07
47 Claude 3 Haiku Anthropic $0.05 $0.34 $1.69 $0.07
48 Qwen Coder Turbo Qwen $0.05 $0.34 $1.69 $0.07
49 Reka Edge Reka $0.04 $0.34 $1.70 $0.10
50 DeepSeek V3.2 DeepSeek $0.05 $0.34 $1.73 $0.08
51 Qwen Coder Turbo V2 Qwen $0.05 $0.34 $1.73 $0.08
52 Groq Llama 3.3 70B Groq $0.04 $0.36 $1.82 $0.12
53 Qwen Plus Qwen $0.05 $0.38 $1.90 $0.10
54 GLM-4-Plus Zhipu AI $0.05 $0.38 $1.92 $0.14
55 Together Mistral Small 3 Together AI $0.05 $0.44 $2.20 $0.16
56 GPT-4.1 mini OpenAI $0.06 $0.46 $2.30 $0.11
57 Llama 4 Maverick Meta $0.06 $0.46 $2.30 $0.11
58 GPT-3.5 Turbo OpenAI $0.06 $0.48 $2.38 $0.13
59 QVQ 72B Preview Qwen $0.06 $0.48 $2.38 $0.13
60 Together Llama 3.3 70B Together AI $0.06 $0.48 $2.42 $0.18
61 Mistral Medium Mistral $0.07 $0.54 $2.70 $0.12
62 Perplexity Sonar Perplexity $0.07 $0.55 $2.75 $0.20
63 Qwen 3 Coder Qwen $0.08 $0.57 $2.88 $0.14
64 DeepSeek Reasoner (R1) DeepSeek $0.08 $0.63 $3.15 $0.15
65 Databricks DBRX Instruct Databricks $0.09 $0.71 $3.56 $0.19
66 Reka Core Reka $0.11 $0.85 $4.25 $0.24
67 Amazon Nova Pro Amazon $0.12 $0.92 $4.60 $0.22
68 Qwen Coder Plus Qwen $0.15 $1.08 $5.40 $0.24
69 Claude 3.5 Haiku Anthropic $0.16 $1.24 $6.21 $0.32
70 Claude 4 Haiku Anthropic $0.16 $1.24 $6.21 $0.32
71 OpenAI o1-mini OpenAI $0.17 $1.27 $6.33 $0.30
72 OpenAI o3-mini OpenAI $0.17 $1.27 $6.33 $0.30
73 OpenAI o4-mini OpenAI $0.17 $1.27 $6.33 $0.30
74 O3 Mini OpenAI $0.17 $1.27 $6.33 $0.30
75 Gemini 1.5 Pro Google $0.19 $1.44 $7.19 $0.34
76 Claude Sonnet 4 Lite Anthropic $0.21 $1.55 $7.76 $0.40
77 Qwen Max Qwen $0.25 $1.84 $9.20 $0.44
78 Mistral Large 2 Mistral $0.25 $1.90 $9.50 $0.50
79 Mistral Large 3 Mistral $0.25 $1.90 $9.50 $0.50
80 Mistral Large 24.07 Mistral $0.25 $1.90 $9.50 $0.50
81 Pixtral Large Mistral $0.25 $1.90 $9.50 $0.50
82 Grok Code xAI $0.28 $2.02 $10.13 $0.45
83 GPT-4.1 OpenAI $0.31 $2.30 $11.50 $0.55
84 Cohere Command A Cohere $0.31 $2.30 $11.50 $0.55
85 Gemini 2.5 Pro Google $0.34 $2.44 $12.19 $0.47
86 Grok 2 xAI $0.37 $2.70 $13.50 $0.60
87 Grok 2 Vision xAI $0.37 $2.70 $13.50 $0.60
88 Gemini 2.0 Pro Google $0.39 $2.88 $14.38 $0.69
89 Cohere Command R+ Cohere $0.39 $2.88 $14.38 $0.69
90 Yi-Large 01.ai $0.39 $2.88 $14.38 $0.69
91 GPT-4o OpenAI $0.41 $3.06 $15.31 $0.78
92 Amazon Nova Premier Amazon $0.46 $3.38 $16.88 $0.75
93 GLM-4-AllTools Zhipu AI $0.46 $3.85 $19.25 $1.40
94 Claude 3 Sonnet Anthropic $0.55 $4.05 $20.25 $0.90
95 Grok 3 xAI $0.55 $4.05 $20.25 $0.90
96 Perplexity Sonar Pro Perplexity $0.55 $4.05 $20.25 $0.90
97 Claude Sonnet 4 Anthropic $0.62 $4.66 $23.29 $1.20
98 Claude 3.5 Sonnet Anthropic $0.62 $4.66 $23.29 $1.20
99 Qwen 3.6 Plus Qwen $0.62 $4.66 $23.29 $1.20
100 Databricks Llama 3.1 405B Databricks $0.63 $4.75 $23.75 $1.25
101 Qwen 3 Max Qwen $0.78 $5.75 $28.75 $1.38
102 Grok 3 Vision xAI $0.78 $5.75 $28.75 $1.38
103 Perplexity Sonar Reasoning Pro Perplexity $0.78 $5.75 $28.75 $1.38
104 Grok 4 xAI $0.93 $6.75 $33.75 $1.50
105 GPT-4 Turbo OpenAI $1.25 $9.50 $47.50 $2.50
106 OpenAI o3 OpenAI $1.55 $11.50 $57.50 $2.75
107 OpenAI o1 OpenAI $2.32 $17.25 $86.25 $4.13
108 O1 Preview OpenAI $2.32 $17.25 $86.25 $4.13
109 Claude 3 Opus Anthropic $2.77 $20.25 $101.25 $4.50
110 GPT-4 OpenAI $2.85 $22.50 $112.50 $6.75
111 OpenAI o1 Pro OpenAI $3.10 $23.00 $115.00 $5.50
112 OpenAI o3 Pro OpenAI $3.10 $23.00 $115.00 $5.50
113 Claude Opus 4 Anthropic $3.08 $23.29 $116.44 $6.02

Which Provider Has the Best Value?

Value depends on what you prioritize. Here's the cheapest model from each provider for a medium project:

ProviderCheapest ModelInput PriceMedium Project CostContext Window
Qwen Qwen Turbo $0.080 $0.08 1M tokens
xAI Grok 3 Mini $0.300 $0.21 128K tokens
Reka Reka Flash $0.200 $0.23 128K tokens
Meta Llama 3.1 8B $0.050 $0.04 128K tokens
OpenAI GPT-4.1 Nano $0.100 $0.12 1M tokens
Microsoft Phi-3 Mini $0.050 $0.04 128K tokens
01.ai Yi-Lightning $0.150 $0.17 16K tokens
Zhipu AI GLM-4-Flash $0.010 $0.01 128K tokens
DeepSeek DeepSeek V3 $0.140 $0.11 128K tokens
Groq Groq Gemma 2 9B $0.200 $0.11 8K tokens
Mistral Mistral Small 3 $0.100 $0.10 32K tokens
MiniMax MiniMax Text 01 $0.050 $0.06 8K tokens
Cohere Cohere Command R $0.150 $0.17 128K tokens
Anthropic Claude 3 Haiku $0.250 $0.34 200K tokens
Amazon Amazon Nova Micro $0.035 $0.04 128K tokens
Stability AI Stable Code 3B $0.050 $0.06 32K tokens
Perplexity Perplexity Sonar $1.00 $0.55 128K tokens
Google Gemini 2.5 Flash Lite $0.037 $0.04 1M tokens
Databricks Databricks DBRX Instruct $0.750 $0.71 32K tokens
Together AI Together Mistral Small 3 $0.800 $0.44 32K tokens

Key Insights

1. Budget models are good enough for 80% of tasks

For code review, documentation, simple scripts, and boilerplate generation, budget models (under $1/M input) perform admirably. The quality gap between budget and premium models narrows significantly for well-defined, routine tasks.

2. Context window size matters more than model quality for large codebases

If you're working with large files or need to provide extensive context, Gemini's 1M token context window is a game-changer. You can analyze an entire codebase in a single request, which is impossible with models capped at 128K or 200K tokens.

3. Prompt caching cuts costs by 30-50%

Models with prompt caching (Anthropic, some OpenAI models) offer significant savings on repeated interactions. A 30% cache hit rate reduces input costs substantially, and real-world usage often achieves 50%+ cache rates for coding tasks with stable context.

4. DeepSeek and Qwen are disrupting Western pricing

DeepSeek's models cost 1/10th to 1/20th of comparable OpenAI models. While the absolute quality may differ slightly, the value proposition is compelling — especially for startups and individual developers.

Methodology

Pricing data collected from official provider websites in April 2026. All costs are calculated per million tokens (USD). Cache hit rate assumed at 30% for models supporting prompt caching. Scenario token counts are estimates based on typical project sizes.

This report is updated whenever pricing changes are announced by providers. Last updated: April 2026.