{"slug": "glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost", "title": "GLM 5.2: Open-Weight Coding Model Beats GPT-5.5 at 1/6 the Cost", "summary": "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.", "body_md": "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](https://huggingface.co/blog/zai-org/glm-52-blog), 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.\n\n## The Numbers\n\nSWE-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.\n\nThe 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.\n\n| Model | SWE-bench Pro | Input (per 1M) | Open Weights |\n|---|---|---|---|\n| GLM-5.2 | 62.1 | $0.95 (OpenRouter) | Yes (MIT) |\n| GPT-5.5 | 58.6 | ~$6 | No |\n| Claude Opus 4.8 | 69.2 | ~$15 | No |\n\n## The Cost Equation\n\nThe performance story is interesting. The cost story is what should actually change your roadmap.\n\nLong-horizon coding agents burn millions of tokens fast. At $0.95 per million input tokens via [OpenRouter](https://openrouter.ai/z-ai/glm-5.2), 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.\n\nZ.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`\n\nendpoint. All three expose OpenAI-compatible APIs — which means switching from GPT-5.5 is a one-line change in your code.\n\n## What MIT License and 1M Context Actually Unlock\n\nGLM-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.\n\nThe 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.\n\nOne 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.\n\n## How to Try It Now\n\nIf 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`\n\n.\n\n``` python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"https://openrouter.ai/api/v1\",\n    api_key=\"YOUR_OPENROUTER_KEY\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"z-ai/glm-5.2\",\n    messages=[{\"role\": \"user\", \"content\": \"Review this function and fix any bugs...\"}]\n)\nprint(response.choices[0].message.content)\n```\n\nThe 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.\n\n## The Bigger Picture\n\nGLM-5.2 is the clearest proof yet that the [open-weight coding gap has closed](https://venturebeat.com/technology/z-ais-open-weights-glm-5-2-beats-gpt-5-5-on-multiple-long-horizon-coding-benchmarks-for-1-6th-the-cost). 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.\n\nZ.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.\n\nThe 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](https://semgrep.dev/blog/2026/we-have-mythos-at-home-glm-52-beats-claude-in-our-cyber-benchmarks/)?", "url": "https://wpnews.pro/news/glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost", "canonical_source": "https://byteiota.com/glm-52-open-weight-coding-model-2/", "published_at": "2026-07-23 08:08:49+00:00", "updated_at": "2026-07-23 08:33:05.862318+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-products", "ai-tools", "ai-infrastructure"], "entities": ["Z.ai", "GLM-5.2", "GPT-5.5", "Claude Opus 4.8", "OpenRouter", "Together AI", "SWE-bench Pro", "Terminal-Bench 2.1"], "alternates": {"html": "https://wpnews.pro/news/glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost", "markdown": "https://wpnews.pro/news/glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost.md", "text": "https://wpnews.pro/news/glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost.txt", "jsonld": "https://wpnews.pro/news/glm-5-2-open-weight-coding-model-beats-gpt-5-5-at-1-6-the-cost.jsonld"}}