# Best model for writing 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.

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.

130 models meet this criterion; 40 are listed below.
Scores come from Artificial Analysis, relayed by the catalogue we read, and are not our own measurement. Prices are ours, each carrying the day we observed it. Full provenance per value: https://bertrande.com/en/best/coding/answer.json

| # | Model | Seller | Coding index | Output $/1M | Observed |
|---|---|---|---|---|---|
| 1 | Claude Fable 5.1 | Anthropic (first party) | 81.6 | $50.00 | 2026-09-18T01:22:49Z |
| 2 | Claude Opus 5 | Anthropic (first party) | 78.0 | $25.00 | 2026-09-18T01:22:49Z |
| 3 | gpt-5.6-sol | OpenAI (first party) | 77.4 | $20.00 | 2026-09-18T02:26:30Z |
| 4 | gpt-6-astra | OpenAI (first party) | 76.9 | $50.00 | 2026-09-18T02:26:30Z |
| 5 | grok-4.6 | xAI (first party) | 76.8 | $6.00 | 2026-09-18T02:46:01Z |
| 6 | gpt-5.6-terra | OpenAI (first party) | 76.7 | $12.00 | 2026-09-18T02:26:30Z |
| 7 | Claude Fable 5 | Anthropic (first party) | 76.5 | $50.00 | 2026-09-18T01:22:49Z |
| 8 | Gemini 3.8 Flash | Google (first party) | 76.3 | $3.75 | 2026-09-18T01:49:01Z |
| 9 | Qwen: Qwen3.8 Max (0902) | OpenRouter | 76.2 | $6.00 | 2026-09-16T04:11:05Z |
| 10 | kimi-k3 | Moonshot AI (first party) | 76.2 | $15.00 | 2026-09-18T02:12:37Z |
| 11 | Gemini 3.7 Flash | Google (first party) | 76.1 | $3.75 | 2026-09-18T01:49:01Z |
| 12 | OpenAI: GPT-5.5 | OpenRouter | 74.9 | $30.00 | 2026-09-18T04:16:25Z |
| 13 | GLM-5.3 | Z.ai (first party) | 74.8 | $4.40 | 2026-09-18T02:52:21Z |
| 14 | Claude Opus 4.8 | Anthropic (first party) | 74.3 | $25.00 | 2026-09-18T01:22:49Z |
| 15 | Claude Opus 4.7 | Anthropic (first party) | 73.6 | $25.00 | 2026-09-18T01:22:49Z |
| 16 | grok-4.5 | xAI (first party) | 72.4 | $6.00 | 2026-09-18T02:46:01Z |
| 17 | Meta: Muse Spark 1.2 | OpenRouter | 72.2 | $4.25 | 2026-09-18T04:16:25Z |
| 18 | Qwen/Qwen3.8-2.4T-A95B | DeepInfra | 71.9 | $6.00 | 2026-09-18T02:52:21Z |
| 19 | GLM-5.3-Flash | Z.ai (first party) | 71.5 | $0.500 | 2026-09-18T02:52:21Z |
| 20 | Claude Sonnet 5 | Anthropic (first party) | 71.5 | $10.00 | 2026-09-18T01:22:49Z |
| 21 | gpt-5.6-luna | OpenAI (first party) | 71.4 | $1.20 | 2026-09-18T02:26:30Z |
| 22 | Meta: Muse Spark 1.1 | OpenRouter | 71.3 | $4.25 | 2026-09-18T04:16:25Z |
| 23 | OpenAI: GPT-5.4 | OpenRouter | 71.1 | $15.00 | 2026-09-18T04:16:25Z |
| 24 | Gemini 3.5 Flash | Google (first party) | 70.1 | $9.00 | 2026-09-18T01:49:01Z |
| 25 | Gemini 3.6 Flash | Google (first party) | 69.2 | $3.75 | 2026-09-18T01:49:01Z |
| 26 | DeepSeek: DeepSeek V4 Flash 0731 | OpenRouter | 69.1 | $0.120 | 2026-09-18T04:16:25Z |
| 27 | Qwen/Qwen3.8-Max | DeepInfra | 68.9 | $4.951 | 2026-09-15T10:09:40Z |
| 28 | DeepSeek: DeepSeek V4 Pro 0813 | OpenRouter | 68.8 | $1.73448 | 2026-09-18T16:15:59Z |
| 29 | GLM-5.2 | Z.ai (first party) | 68.8 | $4.40 | 2026-09-18T02:52:21Z |
| 30 | Google: Gemini 3.1 Pro Preview | OpenRouter | 68.8 | $12.00 | 2026-09-18T04:16:25Z |
| 31 | Qwen/Qwen3.8-27B | Cerebras (first party) | 68.1 | $1.49 | 2026-09-18T02:52:21Z |
| 32 | qwen/qwen3.7-max | Novita AI | 66.0 | $3.75 | 2026-09-17T01:38:56Z |
| 33 | Claude Sonnet 4.6 | Anthropic (first party) | 63.0 | $15.00 | 2026-09-18T01:22:49Z |
| 34 | kimi-k2.6 | Moonshot AI (first party) | 61.8 | $4.00 | 2026-09-18T02:12:37Z |
| 35 | kimi-k2.7-code | Moonshot AI (first party) | 60.8 | $4.00 | 2026-09-18T02:12:37Z |
| 36 | Xiaomi: MiMo-V2.5-Pro | OpenRouter | 60.2 | $0.870 | 2026-09-18T04:16:25Z |
| 37 | Kwaipilot: KAT-Coder-Pro V2 | OpenRouter | 59.5 | $1.20 | 2026-09-18T04:16:25Z |
| 38 | DeepSeek: DeepSeek V4 Pro 0423 | OpenRouter | 59.4 | $3.20 | 2026-09-18T10:12:17Z |
| 39 | Nex AGI: Nex-N2-Pro | OpenRouter | 59.1 | $1.00 | 2026-09-08T02:26:18Z |
| 40 | Tencent: Hy3 preview | OpenRouter | 58.8 | $0.600 | 2026-09-18T04:16:25Z |

Source: https://bertrande.com/en/best/coding/
License: CC-BY-4.0, reuse with attribution.
