Bertrande

Best model for writing code

Which model should I use to write code?

As of 18 September 2026, the model ranking first for this question is Claude Fable 5.1 on Anthropic, with coding index 81.6 and an output price of $50.00 per million tokens. Ranked by highest coding index, then lowest output price at equal index, across 130 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 55Input$ / 1M tokens40 of 40 heldScale from $0.0001 to $600Output$ / 1M tokens40 of 40 heldScale from $0.0001 to $600Contexttokens26 of 40 heldScale from 512 to 2MObserved
1Claude Fable 5.1Anthropic first party81.6$10.00$50.001 000 00018 September 2026
2Claude Opus 5Anthropic first party78.0$5.00$25.001 000 00018 September 2026
3gpt-5.6-solOpenAI first party77.4$4.00$20.00n/a18 September 2026
4gpt-6-astraOpenAI first party76.9$10.00$50.00n/a18 September 2026
5grok-4.6xAI first party76.8$2.00$6.00500 00018 September 2026
6gpt-5.6-terraOpenAI first party76.7$2.00$12.00n/a18 September 2026
7Claude Fable 5Anthropic first party76.5$10.00$50.001 000 00018 September 2026
8Gemini 3.8 FlashGoogle first party76.3$0.750$3.75n/a18 September 2026
9Qwen: Qwen3.8 Max (0902)OpenRouter76.2$2.00$6.001 000 00016 September 2026
10kimi-k3Moonshot AI first party76.2$3.00$15.001 048 57618 September 2026
11Gemini 3.7 FlashGoogle first party76.1$0.750$3.75n/a18 September 2026
12OpenAI: GPT-5.5OpenRouter74.9$5.00$30.001 050 00018 September 2026
13GLM-5.3Z.ai first party74.8$1.40$4.40n/a18 September 2026
14Claude Opus 4.8Anthropic first party74.3$5.00$25.00n/a18 September 2026
15Claude Opus 4.7Anthropic first party73.6$5.00$25.00n/a18 September 2026
16grok-4.5xAI first party72.4$2.00$6.00500 00018 September 2026
17Meta: Muse Spark 1.2OpenRouter72.2$1.25$4.251 048 57618 September 2026
18Qwen/Qwen3.8-2.4T-A95BDeepInfra71.9$2.00$6.00262 14418 September 2026
19GLM-5.3-FlashZ.ai first party71.5$0.150$0.500n/a18 September 2026
20Claude Sonnet 5Anthropic first party71.5$2.00$10.001 000 00018 September 2026
21gpt-5.6-lunaOpenAI first party71.4$0.200$1.20n/a18 September 2026
22Meta: Muse Spark 1.1OpenRouter71.3$1.25$4.251 048 57618 September 2026
23OpenAI: GPT-5.4OpenRouter71.1$2.50$15.001 050 00018 September 2026
24Gemini 3.5 FlashGoogle first party70.1$1.50$9.00n/a18 September 2026
25Gemini 3.6 FlashGoogle first party69.2$0.750$3.75n/a18 September 2026
26DeepSeek: DeepSeek V4 Flash 0731OpenRouter69.1$0.060$0.1201 310 72018 September 2026
27Qwen/Qwen3.8-MaxDeepInfra68.9$1.65$4.951256 00015 September 2026
28DeepSeek: DeepSeek V4 Pro 0813OpenRouter68.8$0.57816$1.734481 048 57618 September 2026
29GLM-5.2Z.ai first party68.8$1.40$4.40n/a18 September 2026
30Google: Gemini 3.1 Pro PreviewOpenRouter68.8$2.00$12.001 048 57618 September 2026
31Qwen/Qwen3.8-27BCerebras first party68.1$0.990$1.4965 53618 September 2026
32qwen/qwen3.7-maxNovita AI66.0$1.25$3.751 000 00017 September 2026
33Claude Sonnet 4.6Anthropic first party63.0$3.00$15.00n/a18 September 2026
34kimi-k2.6Moonshot AI first party61.8$0.950$4.00262 14418 September 2026
35kimi-k2.7-codeMoonshot AI first party60.8$0.950$4.00262 14418 September 2026
36Xiaomi: MiMo-V2.5-ProOpenRouter60.2$0.435$0.8701 050 00018 September 2026
37Kwaipilot: KAT-Coder-Pro V2OpenRouter59.5$0.300$1.20262 14418 September 2026
38DeepSeek: DeepSeek V4 Pro 0423OpenRouter59.4$1.60$3.201 048 57618 September 2026
39Nex AGI: Nex-N2-ProOpenRouter59.1$0.250$1.00262 1448 September 2026
40Tencent: Hy3 previewOpenRouter58.8$0.180$0.600262 14418 September 2026

130 models meet this criterion. The table shows the first 40, so 90 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