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.
| # | Model | Seller | Coding index/ 10040 of 40 heldScale from 3.8 to 55 | Input$ / 1M tokens40 of 40 heldScale from $0.0001 to $600 | Output$ / 1M tokens40 of 40 heldScale from $0.0001 to $600 | Contexttokens26 of 40 heldScale from 512 to 2M | Observed |
|---|---|---|---|---|---|---|---|
| 1 | Claude Fable 5.1 | Anthropic first party | 81.6 | $10.00 | $50.00 | 1 000 000 | 18 September 2026 |
| 2 | Claude Opus 5 | Anthropic first party | 78.0 | $5.00 | $25.00 | 1 000 000 | 18 September 2026 |
| 3 | gpt-5.6-sol | OpenAI first party | 77.4 | $4.00 | $20.00 | n/a | 18 September 2026 |
| 4 | gpt-6-astra | OpenAI first party | 76.9 | $10.00 | $50.00 | n/a | 18 September 2026 |
| 5 | grok-4.6 | xAI first party | 76.8 | $2.00 | $6.00 | 500 000 | 18 September 2026 |
| 6 | gpt-5.6-terra | OpenAI first party | 76.7 | $2.00 | $12.00 | n/a | 18 September 2026 |
| 7 | Claude Fable 5 | Anthropic first party | 76.5 | $10.00 | $50.00 | 1 000 000 | 18 September 2026 |
| 8 | Gemini 3.8 Flash | Google first party | 76.3 | $0.750 | $3.75 | n/a | 18 September 2026 |
| 9 | Qwen: Qwen3.8 Max (0902) | OpenRouter | 76.2 | $2.00 | $6.00 | 1 000 000 | 16 September 2026 |
| 10 | kimi-k3 | Moonshot AI first party | 76.2 | $3.00 | $15.00 | 1 048 576 | 18 September 2026 |
| 11 | Gemini 3.7 Flash | Google first party | 76.1 | $0.750 | $3.75 | n/a | 18 September 2026 |
| 12 | OpenAI: GPT-5.5 | OpenRouter | 74.9 | $5.00 | $30.00 | 1 050 000 | 18 September 2026 |
| 13 | GLM-5.3 | Z.ai first party | 74.8 | $1.40 | $4.40 | n/a | 18 September 2026 |
| 14 | Claude Opus 4.8 | Anthropic first party | 74.3 | $5.00 | $25.00 | n/a | 18 September 2026 |
| 15 | Claude Opus 4.7 | Anthropic first party | 73.6 | $5.00 | $25.00 | n/a | 18 September 2026 |
| 16 | grok-4.5 | xAI first party | 72.4 | $2.00 | $6.00 | 500 000 | 18 September 2026 |
| 17 | Meta: Muse Spark 1.2 | OpenRouter | 72.2 | $1.25 | $4.25 | 1 048 576 | 18 September 2026 |
| 18 | Qwen/Qwen3.8-2.4T-A95B | DeepInfra | 71.9 | $2.00 | $6.00 | 262 144 | 18 September 2026 |
| 19 | GLM-5.3-Flash | Z.ai first party | 71.5 | $0.150 | $0.500 | n/a | 18 September 2026 |
| 20 | Claude Sonnet 5 | Anthropic first party | 71.5 | $2.00 | $10.00 | 1 000 000 | 18 September 2026 |
| 21 | gpt-5.6-luna | OpenAI first party | 71.4 | $0.200 | $1.20 | n/a | 18 September 2026 |
| 22 | Meta: Muse Spark 1.1 | OpenRouter | 71.3 | $1.25 | $4.25 | 1 048 576 | 18 September 2026 |
| 23 | OpenAI: GPT-5.4 | OpenRouter | 71.1 | $2.50 | $15.00 | 1 050 000 | 18 September 2026 |
| 24 | Gemini 3.5 Flash | Google first party | 70.1 | $1.50 | $9.00 | n/a | 18 September 2026 |
| 25 | Gemini 3.6 Flash | Google first party | 69.2 | $0.750 | $3.75 | n/a | 18 September 2026 |
| 26 | DeepSeek: DeepSeek V4 Flash 0731 | OpenRouter | 69.1 | $0.060 | $0.120 | 1 310 720 | 18 September 2026 |
| 27 | Qwen/Qwen3.8-Max | DeepInfra | 68.9 | $1.65 | $4.951 | 256 000 | 15 September 2026 |
| 28 | DeepSeek: DeepSeek V4 Pro 0813 | OpenRouter | 68.8 | $0.57816 | $1.73448 | 1 048 576 | 18 September 2026 |
| 29 | GLM-5.2 | Z.ai first party | 68.8 | $1.40 | $4.40 | n/a | 18 September 2026 |
| 30 | Google: Gemini 3.1 Pro Preview | OpenRouter | 68.8 | $2.00 | $12.00 | 1 048 576 | 18 September 2026 |
| 31 | Qwen/Qwen3.8-27B | Cerebras first party | 68.1 | $0.990 | $1.49 | 65 536 | 18 September 2026 |
| 32 | qwen/qwen3.7-max | Novita AI | 66.0 | $1.25 | $3.75 | 1 000 000 | 17 September 2026 |
| 33 | Claude Sonnet 4.6 | Anthropic first party | 63.0 | $3.00 | $15.00 | n/a | 18 September 2026 |
| 34 | kimi-k2.6 | Moonshot AI first party | 61.8 | $0.950 | $4.00 | 262 144 | 18 September 2026 |
| 35 | kimi-k2.7-code | Moonshot AI first party | 60.8 | $0.950 | $4.00 | 262 144 | 18 September 2026 |
| 36 | Xiaomi: MiMo-V2.5-Pro | OpenRouter | 60.2 | $0.435 | $0.870 | 1 050 000 | 18 September 2026 |
| 37 | Kwaipilot: KAT-Coder-Pro V2 | OpenRouter | 59.5 | $0.300 | $1.20 | 262 144 | 18 September 2026 |
| 38 | DeepSeek: DeepSeek V4 Pro 0423 | OpenRouter | 59.4 | $1.60 | $3.20 | 1 048 576 | 18 September 2026 |
| 39 | Nex AGI: Nex-N2-Pro | OpenRouter | 59.1 | $0.250 | $1.00 | 262 144 | 8 September 2026 |
| 40 | Tencent: Hy3 preview | OpenRouter | 58.8 | $0.180 | $0.600 | 262 144 | 18 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.