Updated July 2026

The Cheapest AI Coding Models in 2026, Compared

The cheapest coding model that is still genuinely capable is DeepSeek V4-Pro — open-weight, 1M context, and roughly 28x cheaper on output than Claude Opus 4.8. The best open-weight quality is GLM-5.2 at 62.1% on SWE-bench Pro. Below is the full price-versus-benchmark table, the caveats that matter, and who each model is actually for.

Editorial hero illustration for Cheapest AI Coding Models in 2026 (Compared)

The Short Answer

If you only need one takeaway: the cheapest coding model that is still genuinely capable in 2026 is DeepSeek V4-Pro, and the best model you can download and run yourself is GLM-5.2. Everything else in this guide is about the trade-offs around those two.

DeepSeek V4-Pro costs about $0.435 per million input tokens and $0.87 per million output tokens. That output price is roughly 28 times cheaper than Claude Opus 4.8 and about 34 times cheaper than GPT-5.5. Put differently, one dollar buys around 1.15 million output tokens from V4-Pro versus roughly 40,000 from Opus 4.8. It is MIT-licensed, has a 1M-token context window, and behaves like a strong implementer — less impressive as a planner.

GLM-5.2 is the quality pick among open weights. It posts 62.1% on SWE-bench Pro, the highest open-weight score on the public leaderboard, at roughly a sixth of the price of the top closed model. If your bottleneck is planning and spec-drafting rather than raw token cost, GLM-5.2 is the model to reach for.

The uncomfortable fact for the incumbents: OpenAI's cheapest tier, GPT-5.6 Luna at $1 input and $6 output, is more expensive on output than GLM-5.2 and multiples more than DeepSeek. The cheap frontier is now open-weight. For the OpenAI side of that story, see our GPT-5.6 Sol, Terra, and Luna explainer.

TL;DR picks
  • Cheapest capable: DeepSeek V4-Pro ($0.435 / $0.87).
  • Best open-weight quality: GLM-5.2 (62.1% SWE-bench Pro).
  • Cheapest for trivial edits: DeepSeek V4-Flash ($0.14 / $0.28).

Price and Benchmark Table

The table is sorted by output price, cheapest first, because output tokens dominate coding costs — agents read a little and write a lot. Prices are per one million tokens and vary by host, so ranges are shown where they matter. The coding column uses SWE-bench Pro where a figure exists; where the public headline is the easier SWE-bench Verified, it is labeled as such.

ModelInput / 1MOutput / 1MContextBest coding benchOpen / Closed
DeepSeek V4-Flash$0.14$0.281MLight implementer; weak on hard SWE tasksOpen (MIT)
Qwen3.6-27B~$0.10-0.30 (free self-host)~$0.30~256K (unconfirmed)77.2% SWE-bench Verified; 53.5 SWE-bench ProOpen (Apache 2.0)
DeepSeek V4-Pro$0.435$0.871M~80.6% Verified (Pro figures conflict)Open (MIT)
GLM-5.2$0.94-$1.40$3.00-$4.401M62.1% SWE-bench Pro (top open-weight)Open (MIT)
GPT-5.6 Luna$1.00$6.001M (family)~84% Terminal-Bench 2.1 (varies by source)Closed
Gemini 3.5 Flash$1.50$9.00~1MUnconfirmedClosed
Claude Sonnet 5$2.00 (promo, then $3)$10.00 (promo, then $15)1MAgent-tuned (not disclosed)Closed
GPT-5.6 Terra$2.50$15.001M (family)Terminal-Bench 2.1 (varies by source)Closed
Claude Opus 4.8 (ref)$5.00$25.001M69.2% SWE-bench Pro (top purchasable)Closed
GPT-5.6 Sol (ref)$5.00$30.001M91.9% Terminal-Bench 2.1 (ultra mode)Closed

The last two rows are reference points, not budget picks: Claude Opus 4.8 is the strongest purchasable coding model on SWE-bench Pro, and GPT-5.6 Sol is OpenAI's frontier tier. Note also that GPT-5.6 is not yet on the public SWE-bench Pro leaderboard because access is gated, so its coding column uses Terminal-Bench 2.1 instead, and those numbers move around by source.

Reading It for a Buyer

Cheapest capable coding model: DeepSeek V4-Pro. At $0.435 input and $0.87 output, its output is about 28.7x cheaper than Opus 4.8 and about 34.5x cheaper than GPT-5.5. V4-Pro is a 1.6T-parameter MoE with roughly 49B active parameters; the smaller V4-Flash is 284B with about 13B active. Both carry a 1M context window and an MIT license, both launched April 24, 2026, and the 75% launch promotion was made permanent on May 22, 2026. V4-Pro is a strong implementer and a weaker planner, so it pairs well with a stronger model doing the design work.

Best open-weight quality: GLM-5.2. Its 62.1% on SWE-bench Pro is the top open-weight result and clears GPT-5.5 (58.6%) at a fraction of the cost — roughly a sixth of GPT-5.5 on output. GLM-5.2 is MIT-licensed, a 744B-parameter MoE with about 40B active parameters, and 1M context. In the field its reputation is planning and spec-drafting, not just churning out patches. If you are choosing between managed frontier tiers instead, our Claude Sonnet 5 vs Opus 4.8 comparison covers that trade-off.

Cheapest of all, with an asterisk. On blended-cost tables, MiMo-V2.5 Flash ($0.10 / $0.30) edges out DeepSeek V4-Flash ($0.14 / $0.28) for the absolute floor. Both are light models that fade on hard SWE tasks, so treat them as high-volume workers for simple edits, boilerplate, and refactors — not for architecture or gnarly debugging.

OpenAI's floor sits above the open frontier. GPT-5.6 Luna is OpenAI's cheapest tier at $1 / $6, yet its output price is higher than GLM-5.2 and far above DeepSeek. If you want an OpenAI model specifically you can have it, but you are paying a brand premium over open weights that score as well or better on coding.

SWE-bench Pro Rankings

Price only matters relative to capability, so here is the coding yardstick that the table above leans on. These are the current SWE-bench Pro aggregate scores. Higher is better; the leaderboard is dominated at the top by one closed model and one open-weight model.

RankModelSWE-bench ProNotes
1Claude Opus 4.869.2Top purchasable score
2GLM-5.262.1Top open-weight
3Qwen3.7-Max60.6Open
4MiniMax-M359.0Open
5GPT-5.558.6Closed
5Kimi K2.658.6Open (tied)
7GPT-5.3-Codex56.8Closed
8DeepSeek V4-Pro-Max55.4Open (see caveats)
9Gemini 3.1 Pro54.2Closed

Two entries were suspended from the public leaderboard and are excluded above: Claude Fable 5 (around 80.0%) and Claude Mythos Preview (77.8%), both pulled amid the U.S. export-control action against Anthropic. The takeaway for a buyer on a budget is the same either way: GLM-5.2 at rank two is the only open-weight model within striking distance of the best purchasable score, and it costs a fraction of it.

Caveats and Gotchas

Benchmarks are harness-dependent. SWE-bench Pro numbers depend heavily on the surrounding agent scaffolding, and the same model can swing well over a dozen points between setups. DeepSeek V4-Pro is the clearest example: its SWE-bench Pro figure is reported as 55.4, then 76.2 on different pages from the same aggregator — a spread north of 20 points. That is why this guide leads with the model's ~80.6% SWE-bench Verified headline and flags the Pro number as unstable rather than picking one and pretending it is settled.

Sonnet 5 pricing is promotional. The $2 input / $10 output rate holds only through August 31, 2026. After that it reverts to $3 / $15. If you are sizing a budget past the summer, use the higher post-promo numbers, not the headline promo.

Prices vary by host. GLM-5.2 spans roughly $0.94-$1.40 input and $3.00-$4.40 output depending on whether you route through OpenRouter, DeepInfra, or Z.ai directly. Advertised free tiers (large ZCODE token grants, limited Hugging Face windows) are promotional and dated, so do not build a permanent budget on them.

Two spec caveats. Qwen3.6-27B is Apache 2.0 (not MIT), and its roughly 256K context window is unconfirmed. Treat both as provisional until the model card firms up.

Data and IP risk on hosted Chinese coding plans. Some low-cost coding subscriptions have unclear terms about whether your code can be retained or used for training. For sensitive codebases, prefer bring-your-own-key, self-hosting, or a US-hosted endpoint rather than the cheapest managed plan.

What Developers Report

Vendor benchmarks are one thing; production spend is another. Two signals from the field are worth more than any single leaderboard row, because they reflect real teams moving real budgets.

The pattern in both is the same one the pricing table implies: open-weight models are now good enough that switching a chunk of traffic to them is a straightforward cost cut, not a downgrade. To actually wire one into your workflow, an editor with bring-your-own-key support plus the right tooling gets you most of the way — see our best MCP servers for Claude Code for the tool layer that makes cheaper models more useful.

FAQ

What is the cheapest capable AI coding model in 2026?

DeepSeek V4-Pro, at about $0.435 per million input tokens and $0.87 per million output tokens. Its output is roughly 28 times cheaper than Claude Opus 4.8, it ships under an MIT license, and it has a 1M-token context window. It is a strong implementer, though a weaker planner than GLM-5.2.

What is the best open-weight coding model?

GLM-5.2. It scores 62.1% on SWE-bench Pro, the top open-weight result, and beats GPT-5.5 at 58.6% for roughly a sixth of the price. It is MIT-licensed, a 744B-parameter mixture-of-experts model with about 40B active parameters, and supports a 1M-token context window.

Is OpenAI's cheapest model cheaper than open-weight models?

No. GPT-5.6 Luna, OpenAI's cheapest tier at $1 input and $6 output, is pricier on output than GLM-5.2 and multiples more than DeepSeek V4-Flash at $0.14 in and $0.28 out. Open-weight frontier models currently undercut OpenAI's floor.

How reliable are these coding benchmarks?

Treat them as directional, not exact. SWE-bench Pro is harness-sensitive, so the same model can swing well over a dozen points depending on scaffolding. DeepSeek V4-Pro alone is reported anywhere from about 55% to 76% on SWE-bench Pro across one aggregator's own pages, which is why this guide leads with its ~80.6% SWE-bench Verified figure instead.

Is Claude Sonnet 5 really $2 / $10?

Only through August 31, 2026. That is promotional pricing. After the promo ends, Claude Sonnet 5 returns to $3 per million input tokens and $15 per million output tokens, so factor the post-promo price into any long-term budget.

Are the DeepSeek V4 prices permanent?

Yes. DeepSeek shipped V4-Pro and V4-Flash on April 24, 2026 with a 75% promotional discount, then made that pricing permanent on May 22, 2026. Unlike the Sonnet 5 promo, these are the standing rates.

Glossary

SWE-bench Verified: 500 human-verified real GitHub issues. The friendlier of the two SWE-bench variants, so headline numbers on it run higher.

SWE-bench Pro: Harder, active-repository tasks with larger diffs and less public ground truth. The stricter coding yardstick used for the ranking table below.

Terminal-Bench 2.1: Terminal and agent tasks run inside a mini-agent harness. Used for the GPT-5.6 tier scores, which vary noticeably by reporting source.

MoE (mixture of experts): An architecture that routes each token to a subset of parameters. DeepSeek V4-Pro is a 1.6T-parameter MoE with about 49B active per token.

Open-weight: Weights are downloadable under a license such as MIT or Apache 2.0. You can self-host, but you do not necessarily get training code or data.

Context window: How many tokens the model can read at once. Most models here are 1M; Qwen3.6-27B is smaller at roughly 256K (unconfirmed).

BYOK: Bring Your Own Key. Point an editor such as Cursor or Claude Code at your own API key for a cheaper or open-weight model.

Verdict

There is no single cheapest-and-best answer, but the decision is simple once you know your constraint:

  • High volume, cost-sensitive, non-sensitive code: DeepSeek V4-Pro, dropping to V4-Flash for the most trivial edits.
  • Best open-weight quality and planning: GLM-5.2, ideally self-hosted or on a US-hosted endpoint if your code is sensitive.
  • Managed and strong, already in Claude: Claude Sonnet 5 while the promo lasts, or Opus 4.8 for the hardest work.
  • Committed to OpenAI: GPT-5.6 Luna or Terra — capable, but you pay a premium over open weights that score as well.

The honest headline: in 2026 the cheapest capable coding models are open-weight, and the gap to the best purchasable model is now small enough that cost, not raw capability, is the deciding factor for most teams.

Sources

Figures were checked against live June and July 2026 sources. Where numbers conflict, the conflict is flagged in the text above rather than resolved silently.

Pricing and specs

Benchmarks and leaderboards

Field reports

Get the latest on AI, LLMs & developer tools

New MCP servers, model updates, and guides like this one — delivered weekly.