Skip to content

Best AI model for code generation

In code generation, work within 60 Elo of the best model is available for 80× less: Muse Ember at $0.201 per thousand tasks against $15.98 for Claude Fable 5.2.

123 models rated head to head in this category, not scored by a general benchmark and assumed to transfer. General programming tasks across languages, judged on whether the result works and reads well rather than on a benchmark score.

Highest ratedClaude Fable 5.21393 Elo · $15.98 / 1k tasks
Best valueMuse Ember1340 Elo · $0.201 / 1k tasks

Nothing cheaper is as good

3 models are undominated here: for each, no cheaper model scores within 18 Elo. Everything else in the table below is beaten on both counts at once.

  1. 1Hy4 flash1225 Elo$0.060 / 1k1.05M context
  2. 2Muse Ember1340 Elo$0.201 / 1k1.05M context
  3. 3Gemini 4 Neon1389 Elo$6.05 / 1k1.05M context

Every model rated on code generation

Elo measured in this category specifically. A model strong overall can sit well down this table, which is the whole reason for ranking by task.

#ModelElo$/1kContextHosts
1Claude Fable 5.21393$15.981.00M4
2Gemini 4 Neon1389$6.051.05M5
3Muse Wonder1385$8.061.05M2
4Claude Opus 5.51382$8.061.00M6
5Claude Sonnet 5.51354$4.031.00M5
6GPT-6.1 Sol1353$4.031.05M6
7Gemini 4 Carbon1351$4.031.05M5
8Kimi K31346$6.001.05M29
9Muse Spark 1.31345$1.981.05M2
10Kimi K3.1 Pro1341$4.101.05M28
11Muse Ember1340$0.2011.05M2
12Gemini 4 Hydrogen1330$3.021.05M5
13Claude Fable 5.11323$19.981.00M3
14Gemini 4 Argon1320$4.031.05M5
15Claude Opus 51310$10.261.00M6
16MiMo-V2.6-Pro1308$0.4721.05M4
17Muse Spark 1.21298$1.981.05M1
18Claude Fable 51293$20.521.00M4
19Gemini 3.7 Flash1291$1.541.05M6
20Muse Spark Open1289$1.981.05M5
21Gemini 3.8 Flash1285$1.541.05M6
22DeepSeek V4.1 Flash 10171281$0.2591.05M50
23GLM 5.31275$1.941.05M47
24Claude Haiku 5.51273$0.2051.00M5
25Grok 4.61272$4.50500K4
26Gemini 3.6 Flash1272$1.541.05M6
27Claude Opus 4.61271$10.261.00M5
28GLM 5.21268$1.921.05M30
29GLM 5.3 Flash1260$0.2311.05M41
30Claude Sonnet 51260$4.101.00M5
31Grok 4.71259$3.12500K5
32Muse Spark 1.11259$1.981.05M1
33Claude Sonnet 4.61258$6.161.00M5
34Grok 4.51257$4.36500K4
35Qwen3.7 Max1257$2.251.00M1
36MiMo-V2.5-Pro1255$0.840262K1
37Kimi K2.61254$1.46262K15
38GLM 5.11252$1.98203K8
39Qwen3.7 Plus1251$0.5841.00M2
40Gemini 3.5 Flash1249$3.531.05M6
41Hy41247$1.171.05M3
42Mistral Large 41247$1.061.05M2
43MiMo-V2.51245$0.8501.00M1
44GLM 5 Turbo1244$1.95203K1
45GPT-5.51242$11.761.05M4
46Claude Opus 4.81236$10.261.00M6
47Kimi K2.7 Code1235$1.64262K9
48MiniMax M31228$0.547524K7
49GLM 51228$1.52203K8
50Gemini 3.1 Pro Preview1226$4.701.05M6
51Hy4 flash1225$0.0601.05M1
52Claude Opus 4.51224$10.26200K5
53DeepSeek V4 Pro 04231223$1.531.05M13
54Qwen3.6 Plus1218$0.9751.00M1
55Kimi K2.51218$1.24262K3
56Beam 1.0 501B A23B1215$0.5881.05M5
57MiniMax M2.71215$1.26197K1
58DeepSeek V4 Flash 07311211$0.1721.05M26
59GLM 5V Turbo1210$1.95203K1
60Grok 4.201203$2.172.00M4
61GLM 4.71199$0.939203K6
62GPT-5.41194$5.881.05M4
63MiniMax M2.51189$0.481198K2
64DeepSeek V4 Flash 04231187$0.1521.05M13
65Inkling1186$1.82524K1
66Gemini 3 Flash Preview1171$1.181.05M6
67Grok 4.31167$2.171.00M4
68Claude Sonnet 4.51165$6.161.00M5
69Solar Pro 41162$0.274524K3
70Qwen3.5 397B A17B1162$1.50262K8
71Step 3.7 Flash1161$0.470262K2
72GLM 4.7 Flash1159$0.198131K2
73Hy31158$0.257262K2
74DeepSeek V3.1 Terminus1157$0.624164K1
75GPT-5.11153$3.69400K4
76Claude Opus 4.11153$30.78200K1
77GPT-5.21152$5.17400K4
78DeepSeek V3.2 Exp1152$0.447164K1
79GPT-51150$3.69400K2
80Qwen3.5 Plus 2026-02-151149$0.7801.00M1
81Muse Glimmer 30B1147$0.533131K3
82GLM 4.61147$0.904203K5
83GLM 4.51147$1.03131K1
84DeepSeek V3.21146$0.406164K4
85GPT-5.1-Codex1134$3.69400K1
86Gemini 2.5 Pro1134$3.691.05M3
87Nemotron 3.5 Super VL1131$0.2361.05M11
88GPT-5.3-Codex1126$5.17400K3
89Qwen3 Coder 480B A35B1125$0.603262K2
90Nemotron 3 Ultra1124$1.03262K8
91Mistral Large 3 25121124$0.760262K2
92R1 05281120$1.25164K3
93GLM 4.5 Air1119$0.343131K3
94Solar Mini 41113$0.088524K2
95Mistral Medium 3.11102$0.903131K1
96Claude Haiku 4.51097$2.05200K4
97GPT-5 Mini1097$0.738400K3
98DeepSeek V3.11094$0.523164K3
99DeepSeek V31090$0.576164K3
100Gemini 2.5 Flash1086$0.9161.05M3
101Kimi K2 09051080$1.47262K1
102GPT-5.1-Codex-Mini1076$0.742400K1
103GPT-5 Nano1066$0.148400K3
104Gemini 3.1 Flash Lite Preview1054$0.5881.05M3
105Mistral Medium 31051$0.903131K1
106Ministral 3 14B 25121047$0.178262K2
107Ministral 3 8B 25121035$0.134262K2
108Qwen3 235B A22B Instruct 25071020$0.326262K5
109Qwen3 235B A22B Thinking 25071015$1.59128K1
110Kimi K2 07111015$1.37131K1
111GPT-4.11007$3.721.05M2
112o31001$3.72200K1
113Ministral 3 3B 2512992$0.089131K2
114Codestral 2508989$0.436256K1
115GPT-4.1 Mini975$0.7441.05M2
116o4 Mini (batch)958$1.02200Kn/a
117gpt-oss-120b945$0.249131K24
118GPT-4.1 Nano945$0.1901.05M1
119Qwen3 30B A3B924$0.29441K3
120Mistral Small 3.2 24B889$0.183128K5
121Llama 4 Maverick861$0.590524K1
122GPT-4o842$5.10128K2
123Llama 4 Scout771$0.210328K3

Other tasks

Elo comes from head-to-head build-offs via OpenRouter, compiled 23 November 2026 and refreshed daily. Cost is the median across every host serving each model, priced on 1,200 input and 300 output tokens with 60% cached. See the findings for method, or download the data.