Bertrande

Best model for writing code

Which model should I use to write code?

As of 3 November 2026, the model ranking first for this question is Claude Fable 5.1 on Anthropic, with coding index 80.7 and an output price of $50.00 per million tokens. Ranked by highest coding index, then lowest output price at equal index, across 134 models for which we hold both figures. This ranking ignores speed and reliability: it is a query on price and a relayed capability score, not a verdict on which model serves you best.

How this ranking is built

Criterion: highest coding index, then lowest output price at equal index. The coding index measures performance on programming tasks specifically, which is not the same thing as general intelligence.

This is a query, not an opinion. Both figures are shown on every row so you can check the order, and the table sorts on any column if you disagree with our criterion.

Two things to know before trusting this table. Capability scores are published by Artificial Analysis and relayed by the catalogue we read. They are not our measurement, and a score measures the model rather than the seller, so we apply it to every seller of that model. This ranking says nothing about speed or reliability, which we measure only in part: availability is published per upstream host in reliability.json and on the model pages, and we publish no latency at all, for reasons given on the data page. Prices are ours to observe, each carries the date we saw it, and we keep only the cheapest offer per model so that batch and free tiers do not crowd out the answer.

#ModelSellerCoding index/ 10040 of 40 heldScale from 3.8 to 58.4Input$ / 1M tokens40 of 40 heldScale from $0.003 to $600Output$ / 1M tokens40 of 40 heldScale from $0.003 to $600Contexttokens26 of 40 heldScale from 512 to 2MObserved
1Claude Fable 5.1Anthropic first party80.7$10.00$50.001 000 0003 November 2026
2gpt-5.6-solOpenAI first party78.3$4.00$20.00n/a31 October 2026
3Claude Opus 5Anthropic first party78.0$5.00$25.001 000 00030 October 2026
4gpt-6-astraOpenAI first party76.9$10.00$50.00n/a31 October 2026
5grok-4.6xAI first party76.8$2.00$6.00500 0002 November 2026
6gpt-5.6-terraOpenAI first party76.7$2.00$12.00n/a31 October 2026
7Claude Fable 5Anthropic first party76.5$10.00$50.001 000 00030 October 2026
8Gemini 3.8 FlashGoogle first party76.3$0.750$3.75n/a2 November 2026
9Qwen: Qwen3.8 Max (0902)OpenRouter76.2$2.00$6.001 000 0003 November 2026
10Gemini 3.7 FlashGoogle first party76.1$0.750$3.75n/a3 October 2026
11Meta: Muse Spark 1.3OpenRouter75.8$1.25$4.251 048 5763 November 2026
12OpenAI: GPT-5.5OpenRouter74.9$5.00$30.001 050 0003 November 2026
13GLM-5.3Z.ai first party74.8$1.40$4.40n/a3 November 2026
14Claude Opus 4.8Anthropic first party74.3$5.00$25.00n/a30 October 2026
15Claude Opus 4.7Anthropic first party73.6$5.00$25.00n/a30 October 2026
16grok-4.5xAI first party72.4$2.00$6.00500 0002 November 2026
17Meta: Muse Spark 1.2OpenRouter72.2$1.25$4.251 048 5763 November 2026
18kimi-k3Moonshot AI first party72.0$3.00$15.001 048 5763 November 2026
19Qwen/Qwen3.8-2.4T-A95BDeepInfra71.9$2.00$6.00262 1443 November 2026
20GLM-5.3-FlashZ.ai first party71.5$0.150$0.500n/a3 November 2026
21Claude Sonnet 5Anthropic first party71.5$2.00$10.001 000 00030 October 2026
22gpt-5.6-lunaOpenAI first party71.4$0.200$1.20n/a31 October 2026
23Meta: Muse Spark 1.1OpenRouter71.3$1.25$4.251 048 5762 November 2026
24OpenAI: GPT-5.4OpenRouter71.1$2.50$15.001 050 0003 November 2026
25Gemini 3.5 FlashGoogle first party70.1$1.50$9.00n/a3 October 2026
26Gemini 3.6 FlashGoogle first party69.2$0.750$3.75n/a2 November 2026
27deepseek-ai/DeepSeek-V4-Flash-0731DeepInfra69.1$0.060$0.1801 048 5763 November 2026
28Qwen/Qwen3.8-MaxDeepInfra68.9$1.65$4.951256 00028 October 2026
29deepseek-ai/DeepSeek-V4-Pro-0813DeepInfra68.8$1.30$2.601 048 5763 November 2026
30GLM-5.2Z.ai first party68.8$1.40$4.40n/a3 November 2026
31Google: Gemini 3.1 Pro PreviewOpenRouter68.8$2.00$12.001 048 5763 November 2026
32Qwen/Qwen3.8-27BCerebras first party68.1$0.990$1.4965 5363 November 2026
33qwen/qwen3.7-maxNovita AI66.0$1.25$3.751 000 00031 October 2026
34deepseek-v4-flash-vision-expDeepSeek first party65.0$0.440$1.321 000 0004 September 2026
35Claude Sonnet 4.6Anthropic first party63.0$3.00$15.00n/a30 October 2026
36kimi-k2.6Moonshot AI first party61.8$0.950$4.00262 1443 November 2026
37kimi-k2.7-codeMoonshot AI first party60.8$0.950$4.00262 1443 November 2026
38xiaomimimo/mimo-v2.5-proNovita AI60.2$0.522$1.0441 048 57622 October 2026
39Kwaipilot: KAT-Coder-Pro V2OpenRouter59.5$0.300$1.20262 14421 September 2026
40DeepSeek: DeepSeek V4 Pro 0423OpenRouter59.4$1.60$3.201 048 5763 November 2026

134 models meet this criterion. The table shows the first 40, so 94 ranked below the cut are not listed here; the full catalogue holds them all.

A model missing from this table is missing one of the two figures, not judged. We would rather show a shorter list than fill it with guesses.

Other questions we can answer this way