cd /news/artificial-intelligence/glm-5-2-open-weight-coding-model-bea… · home topics artificial-intelligence article
[ARTICLE · art-69806] src=byteiota.com ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

GLM 5.2: Open-Weight Coding Model Beats GPT-5.5 at 1/6 the Cost

Z.ai released GLM-5.2, an open-weight coding model under MIT license, scoring 62.1 on SWE-bench Pro against GPT-5.5's 58.6 at roughly one-sixth the cost ($0.95 per million input tokens via OpenRouter). The model also leads on Terminal-Bench 2.1 (81.0) and FrontierSWE (74.4), with a 1M token context window, though Claude Opus 4.8 still holds higher scores (69.2 SWE-bench Pro, 85.0 Terminal-Bench) at higher cost.

read4 min views1 publishedJul 23, 2026
GLM 5.2: Open-Weight Coding Model Beats GPT-5.5 at 1/6 the Cost
Image: Byteiota (auto-discovered)

An open-weight coding model from Z.ai just beat GPT-5.5 on the benchmark most developers actually care about — and it costs a sixth as much to run. GLM-5.2, released June 13 under an MIT license, scores 62.1 on SWE-bench Pro against GPT-5.5’s 58.6. At $0.95 per million input tokens via OpenRouter, the cost argument for keeping closed-source models in your coding pipeline just got a lot harder to make.

The Numbers #

SWE-bench Pro measures what matters: fixing real bugs in real repositories, not curated toy problems. GLM-5.2’s 62.1 is the strongest score any open-weight model has posted there. It also leads on Terminal-Bench 2.1 (81.0, up 17.5 points from its predecessor) and FrontierSWE (74.4), which tests long-horizon multi-step agent tasks.

The honest comparison: Claude Opus 4.8 still holds 69.2 on SWE-bench Pro and 85.0 on Terminal-Bench. If you are running a task where every percentage point matters — production code reviews, high-stakes agentic loops — Opus 4.8 is still ahead. But for a model you can download and modify under MIT, the gap is smaller than anyone expected six months ago.

Model SWE-bench Pro Input (per 1M) Open Weights
GLM-5.2 62.1 $0.95 (OpenRouter) Yes (MIT)
GPT-5.5 58.6 ~$6 No
Claude Opus 4.8 69.2 ~$15 No

The Cost Equation #

The performance story is interesting. The cost story is what should actually change your roadmap.

Long-horizon coding agents burn millions of tokens fast. At $0.95 per million input tokens via OpenRouter, GLM-5.2 is roughly one-sixth the per-token cost of GPT-5.5 and one-fifteenth the cost of Opus 4.8. For teams running code review bots, test generation pipelines, or multi-step agentic workflows, that is not a rounding error — it is the difference between running these systems sustainably and quietly shelving them because the API bill does not justify the output.

Z.ai’s direct pricing ($1.40/$4.40 per million input/output) is already competitive. OpenRouter’s rate ($0.95/$3.00) is lower still. Together AI also carries it via the zai-org/GLM-5.2

endpoint. All three expose OpenAI-compatible APIs — which means switching from GPT-5.5 is a one-line change in your code.

What MIT License and 1M Context Actually Unlock #

GLM-5.2’s weights are MIT — not a custom “open” license with commercial restrictions, not weights you can inspect but not deploy. MIT means you can fine-tune on your codebase, ship it in a product, redistribute it, and run it air-gapped if your data governance requirements demand it.

The 1M token context window (up from 200K in GLM-5.1) is the other unlock. A mid-sized TypeScript service — 50K lines of dense code or 150K lines of typical TS — fits in a single call. You stop chunking, stop managing retrieval pipelines for repo-level questions, and the model sees the full dependency graph when it reasons about a change.

One caveat on self-hosting: full-precision GLM-5.2 weights are 1.51 TB. You need roughly 19 H100 80GB cards at minimum. FP8 quantization cuts that to around 744 GB — still an enterprise GPU node. For most developers, managed API access is the practical path, and the cost is already low enough that self-hosting’s economics only make sense at very high, steady inference volume.

How to Try It Now #

If you are already running an OpenAI-compatible coding agent — Claude Code with a custom provider, Cline, Cursor, or a homegrown setup — switching costs are minimal. The model ID on OpenRouter is z-ai/glm-5.2

.

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="YOUR_OPENROUTER_KEY"
)

response = client.chat.completions.create(
    model="z-ai/glm-5.2",
    messages=[{"role": "user", "content": "Review this function and fix any bugs..."}]
)
print(response.choices[0].message.content)

The function-calling format is OpenAI-compatible. Agentic harnesses that work with GPT-5.5 should work with GLM-5.2 without modification. Two configurable reasoning-effort levels let you tune latency versus quality per request.

The Bigger Picture #

GLM-5.2 is the clearest proof yet that the open-weight coding gap has closed. Chinese open-weight providers now account for over 45% of OpenRouter’s developer token traffic. Closed-source models still win on reasoning, multimodal tasks, and computer use — but if coding is your primary use case, open weights at frontier-adjacent quality now exist at prices that make every other choice look expensive.

Z.ai’s Chinese origin is worth noting for enterprise teams with strict data residency or geopolitical restrictions. MIT weights are freely redistributable and fully air-gappable, but procurement and legal teams will still raise questions. That constraint is real for a narrow set of use cases. For most developers, it is not the deciding factor.

The question has shifted. It used to be: is there an open-weight coding model good enough to consider? GLM-5.2 answers that with a yes. The new question is simpler: what does your current coding AI pipeline cost per month, and have you run the numbers at $0.95 per million tokens?

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @z.ai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/glm-5-2-open-weight-…] indexed:0 read:4min 2026-07-23 ·