GLM-5.1 Took the SWE-Bench Pro Lead at One-Fifth the Price of Claude Opus 4.6. Coding Routing Has a New Default.
Z.ai's GLM-5.1 launched April 7 under MIT license, scored 58.4 on SWE-Bench Pro (above GPT-5.4, Claude Opus 4.6, and Gemini 3.1 Pro), and ships at $0.95 per million input tokens. For code-generation workloads, the routing math just flipped.
Z.ai released GLM-5.1 on April 7, 2026. It scored 58.4 on SWE-Bench Pro, beating GPT-5.4, Claude Opus 4.6, and Gemini 3.1 Pro on what is currently the most-cited coding benchmark. The weights are MIT-licensed. The API price is $0.95 per million input tokens. The model is a 754B-parameter Mixture-of-Experts with a 200K context window and 128K output capacity. It was trained on 100,000 Huawei Ascend 910B chips, with zero NVIDIA hardware in the training stack.
Most of those facts are interesting trivia for the AI-news cycle. One of them changes a routing decision that almost every engineering team has wired into production: which model to route code-generation workloads to. For the last two years the answer has been "Claude Opus" or "GPT-5.x." Both choices land at $2.50-$5 input and $15-$25 output. GLM-5.1 at $0.95 input, with a higher SWE-Bench Pro score, breaks that default.
This post is about which coding workloads actually win by switching, the three routing mistakes most teams will make in the next month, and why "GLM-5.1 is open-weight" is the second-most-important fact about this release, not the first.
What SWE-Bench Pro is actually measuring
SWE-Bench Pro is a refined version of the original SWE-Bench: real-world software engineering tasks scraped from GitHub issues, where the model has to read a repository, understand a bug or feature request, and produce a patch that passes the project's own tests. It is the closest thing the field has to a benchmark that measures "can this model do my engineer's job."
A score of 58.4 means the model resolved 58.4% of the test instances correctly, end-to-end. Claude Opus 4.6 sits around 56-57%. GPT-5.4 sits around 54-55%. Gemini 3.1 Pro sits around 52%. The gap between GLM-5.1 and the runner-up is small but consistent across the public eval runs.
The benchmark does not measure: code style, code review quality, documentation generation, or the kind of "explain what this codebase does" workloads that look like coding but are actually summarization. Those workloads have their own quality leaders, and GLM-5.1 is not necessarily ahead on them.
The routing implication: SWE-Bench Pro performance maps cleanly onto autonomous-coding-agent workloads (issue-to-PR pipelines, automated bug fixers, code-modification agents). It maps less cleanly onto interactive coding assistants where the human is in the loop. For the former category, GLM-5.1 is the new routing default. For the latter, it is one option among several.
The cost math on a real coding workload
Take a team running an autonomous code-modification agent that handles routine refactors, dependency updates, and small bug fixes. Typical monthly volume:
- 5,000 issues processed
- Average issue: 30K input tokens (repo context + issue description + tool definitions) and 8K output tokens (the patch + reasoning trace)
- 150M monthly input tokens, 40M monthly output tokens
On Claude Opus 4.6 at $5/$25:
- $750 input + $1,000 output = $1,750/month
On GPT-5.4 at $2.50/$15:
- $375 input + $600 output = $975/month
On GLM-5.1 at roughly $0.95/$2.50 (API tier):
- $142 input + $100 output = $242/month
The SWE-Bench Pro score on GLM-5.1 is higher. The cost is roughly 1/7th of Opus 4.6 and 1/4th of GPT-5.4. For autonomous-coding-agent workloads, this is one of the cleanest cost-and-quality wins of the year.
For teams running coding workloads at frontier-API spend, the savings scale linearly. A $50K/month coding-agent bill drops to $7K-$10K with no measurable quality loss on the SWE-Bench-mapped workload subset. We covered the broader cost-curve mechanics in our DeepSeek R2 vs o3 analysis; the GLM-5.1 release is the coding-side equivalent, except the cost gap is even larger.
The three routing mistakes that will cost teams in May
Mistake one: routing all coding traffic to GLM-5.1 because the SWE-Bench score is higher.
This is the same trap as "everything goes to GPT-5.5 because the demo was impressive." SWE-Bench Pro measures one specific kind of coding capability. Code-explanation workloads, code-review workloads, and pair-programming workloads are not in the benchmark. A team that flips 100% of coding traffic to GLM-5.1 will catch quality regressions on these adjacent workloads in week two and either roll back or scramble to add per-workload routing.
The fix is per-task routing. Autonomous-coding-agent workloads to GLM-5.1. Interactive coding-assistant workloads stay where they are (Claude Opus, GPT-5.4) until comparative evals show GLM-5.1 wins on those specifically.
Mistake two: assuming the cost gap will hold.
GLM-5.1's API tier at $0.95 is set by Z.ai. There is no contractual commitment that the price will stay there. New open-weight releases tend to launch at aggressive pricing and gradually drift up toward the cost-of-inference floor. Teams that lock their entire coding routing decision around the current price are exposing themselves to a future re-routing scramble.
The fix is to wire the routing through a layer that can swap providers without code changes. This is the same dialect-translation argument we walked through in our cross-provider routing post; when GLM-5.1's price drifts, your routing layer can shift the workload to whatever the new cost-quality leader is, without touching application code.
Mistake three: ignoring the open-weight option.
GLM-5.1's MIT license means you can self-host. The model is large (754B parameters, 32B active in the MoE) and serving it requires a multi-GPU rig (8x H100 or 4x B200 minimum for production-grade throughput). For most teams, the API at $0.95 input is cheaper than self-hosting once you account for utilization rates and operational overhead.
The teams that will benefit from self-hosting GLM-5.1 are: regulated industries with data-residency requirements, teams already running multi-GPU inference clusters for other workloads, and teams with sustained sky-high coding volume (above $50K/month on the API tier). For the rest, the API is the right starting point. The self-host option is good optionality to have, not a default.
We covered the parallel self-host-vs-API decision for smaller open-weight models in our Gemma 4 self-host analysis. The key difference for GLM-5.1 is the model size: Gemma 4 31B fits on a single H100 and the self-host math works at modest volumes. GLM-5.1 needs 8 H100s or 4 B200s, which pushes the break-even threshold roughly 8-10x higher.
What this means for the broader coding-routing graph
GLM-5.1 entering the routing graph adds a fourth tier to the typical coding setup:
Tier 1: Tab-complete and inline suggestions. Latency-dominant. GPT-5.4-mini or Gemini Flash-Lite at $0.15-$0.30 input. No change. GLM-5.1 is too slow for this tier.
Tier 2: Conversational coding assistant. Quality-dominant on subtle code understanding. Claude Sonnet 4.6 or GPT-5.4 at $0.50-$2.50 input. GLM-5.1 is a candidate here, but evals on conversational-style tasks lag the SWE-Bench Pro lead. Run evals before flipping.
Tier 3: Autonomous coding agent on routine tasks. SWE-Bench-mapped workloads. GLM-5.1 at $0.95 input is the new default. This is the tier where the cost-quality math is most dramatic.
Tier 4: Hardest coding tasks (deep reasoning, novel architecture). Claude Opus 4.6 or DeepSeek R2 reasoning. Reserved for the 5-10% of cases where Tier 3 fails. The escalation rate determines whether the overall coding bill is dominated by Tier 3 (cheap) or Tier 4 (expensive).
The pattern that wins: route by task type, not by "this is a coding workload, send it to the coding model." The four tiers above are the routing structure that produces the lowest bill at production-grade quality across the breadth of what teams call "coding."
What to actually do this week
If your coding workloads are currently routed to Claude Opus 4.6, GPT-5.4, or any other frontier API as the default:
- Identify the autonomous-coding-agent subset. Issue-to-PR pipelines, automated dependency updates, scheduled refactors. These are the SWE-Bench-mapped workloads.
- Run a 100-case eval on that subset. GLM-5.1 vs your current default. The eval should match your production task structure (real repo context, real issues, real test passes as the success metric).
- If GLM-5.1 wins or ties on quality and you save 50%+ on cost, flip that subset. Keep the rest of your coding workloads on the existing routing.
- Monitor for two weeks. Quality fingerprints can drift on workload-specific tasks even when benchmarks look stable. The 14-day signal is what catches the cases where SWE-Bench-Pro performance does not generalize to your specific repo conventions.
- Reassess at the end of the month. Coding-model leadership has flipped four times in the past year. Lock yourself into a routing layer that can move workloads without code changes, not into a single provider.
How PromptUnit handles this
PromptUnit's routing layer treats GLM-5.1 as another node in the cross-provider graph. The router classifies coding requests by task type (autonomous agent, conversational assist, tab-complete, deep reasoning) and routes to the cheapest provider that meets the quality bar for that task type. The dialect translation layer rewrites OpenAI-format coding requests into Z.ai's API format, so customer code does not change. The 14-day observation period catches the case where SWE-Bench Pro performance does not generalize to a customer's specific repo, by comparing task-completion rates between the new route and the previous default before any traffic shifts. The quality fingerprint signal across all customers improves the routing accuracy over time.
If your monthly coding-LLM bill is more than $5K and you have not evaluated GLM-5.1 against your current routing, the cost gap is now dramatic enough that ignoring it is the expensive choice. Start the free observation period at promptunit.ai and see what your coding workloads should actually cost.