Kimi K2.7 Code vs GLM-5.2: Battle of the Open-Weight Coding Giants
Two open-weight models dropped within days of each other in June 2026, both claiming to rival GPT-5.5 on coding at 1/6th the cost. Here's the honest breakdown.
TL;DR
- 🏆 Kimi K2.7 Code: 1T-param open-weight model, $0.95/M input — up to 12× cheaper than GPT-5.5, strong agent swarm capabilities
- 🧠 GLM-5.2: 744B open-weight, 1M context window, flat $1/$1 pricing — leading open-source SWE-bench score with GLM-5 as baseline (77.8%, verified)
- 💰 Both beat GPT-5.5 on price by 6–12× at their providers’ list prices
- ⚠️ Caveat: K2.7 and GLM-5.2 publish only vendor benchmarks — no independent SWE-bench submission yet
The contenders
Moonshot AI released Kimi K2.7 Code on June 12, 2026 — a 1T-parameter MoE model with 32B active parameters, optimized specifically for coding tasks. Four days later, Zhipu AI (now Z.AI) dropped GLM-5.2, a 744B MoE with 40B active parameters and a 1M-token context window.
Both are open-weight under MIT-compatible licenses. Both can run on self-hosted infrastructure. Both are available through the MegaBrain Gateway today.
| Kimi K2.7 Code | GLM-5.2 | |
|---|---|---|
| Company | Moonshot AI | Z.AI (Zhipu AI) |
| Released | June 12, 2026 | June 16, 2026 |
| Total params | 1T (MoE) | 744B (MoE) |
| Active params | 32B / token | 40B / token |
| Context window | 256K tokens | 1M+ tokens |
| Open weights | ✅ Modified MIT | ✅ MIT |
| Input price | $0.95 / 1M | ~$1.00 / 1M |
| Output price | $4.00 / 1M | ~$1.00 / 1M |
Benchmark reality check
This is where you need to read carefully. Both companies published impressive numbers — but the most recent versions (K2.7 and GLM-5.2) have not yet been independently verified on standard public benchmarks. The numbers below distinguish between vendor self-reported and third-party verified.
Coding (SWE-bench Verified)
| Model | SWE-bench | Verified by |
|---|---|---|
| Kimi K2.7 Code (Kimi Bench v2) | 62.0 | ⚠️ Vendor only |
| GLM-5.2 (SWE-bench Pro) | 62.1 | ⚠️ Vendor only |
| Claude Opus 4.5 | 80.9% | ✅ Third-party |
| GPT-5.2 | 80.0% | ✅ Third-party |
| GLM-5 (predecessor) | 77.8% | ✅ Third-party |
Neither K2.7 nor GLM-5.2 have submitted to the public SWE-bench leaderboard yet — "Kimi Code Bench v2" and "SWE-bench Pro" are proprietary test sets with different harnesses. GLM-5 (the prior version) has 77.8% on the real leaderboard, which gives GLM-5.2 a credible baseline. Kimi K2.7 inherits its reputation from K2.5 (76.8%, verified).
Math & Reasoning
| Model | AIME 2025/26 | GPQA Diamond | Verified by |
|---|---|---|---|
| Kimi K2.7 Code | ~96% (est.) | ~88% (est.) | ⚠️ No public submission |
| GLM-5.2 | 99.2% (2026) | 91.2% | ⚠️ Vendor only |
| Claude Opus 4.5 | 92.8% | ~90% | ✅ Third-party |
Agentic / Terminal tasks
| Model | Terminal-Bench | Verified by |
|---|---|---|
| GLM-5.2 | 81.0 (82.7 best) | ⚠️ Vendor only |
| Claude Opus 4.8 | 85.0 | ✅ Third-party |
| GLM-5 | 56.2 → 60.7 | ✅ Third-party |
Key differences in practice
Code style
Kimi K2 writes verbose, thorough code by design — it tends to handle edge cases proactively and add defensive checks. Good for complex business logic. May produce more code than needed for simple tasks.
GLM-5.2 produces more concise output with better structured formatting. Particularly strong at multi-file debugging and following stack traces through a codebase.
Context & long files
GLM-5.2's 1M-token context window is a genuine differentiator for large codebases — you can load an entire monorepo. Kimi K2.7's 256K window is still excellent (≈ 200,000 lines of code) but loses on this specific dimension.
Agent workflows
Kimi K2.7 supports Agent Swarm — up to 300 concurrent sub-agents coordinating 4,000 steps. Ideal for parallel test generation or large-scale refactors. GLM-5.2 focuses on deep single-agent execution (Terminal-Bench 81.0) — better for complex sequential tasks.
Hardware independence
GLM-5 was trained entirely on Huawei Ascend (no NVIDIA dependency) — a notable consideration for organizations operating under export restrictions or building China-based infrastructure.
What they cost
Both are included in MegaBrain’s paid plans, paid from the plan’s limits. The providers’ own list prices, for context:
| Model | Input | Output | vs GPT-5.5 |
|---|---|---|---|
| Kimi K2.7 Code | $0.95 / 1M | $4.00 / 1M | ~12× cheaper input |
| GLM-5.2 | ~$1.00 / 1M | ~$1.00 / 1M | ~6–8× cheaper overall |
| GLM-5 | $1.00 / 1M | $1.00 / 1M | ~6× cheaper |
| Kimi K2.5 | $0.60 / 1M | $2.50 / 1M | ~15× cheaper input |
| GPT-5.5 | ~$10 / 1M | ~$30 / 1M | baseline |
GLM-5's flat $1/$1 pricing is unusually favorable for output-heavy workloads (long code generation). Kimi K2.7's $4/M output cost is higher but still competitive for reasoning-intensive tasks.
Try both on MegaBrain in 30 seconds
Both models route through the same OpenAI-compatible API. Switch between them by changing the model ID:
import openai
client = openai.OpenAI(
base_url="https://getmegabrain.com/api/gateway/v1",
api_key="mb-your-key-here",
)
# Kimi K2.7 Code
response = client.chat.completions.create(
model="moonshot/kimi-k2.7-code",
messages=[{"role": "user", "content": "Refactor this function to use async/await"}],
)
# GLM-5.2 — just change the model ID
response = client.chat.completions.create(
model="zhipu/glm-5.2",
messages=[{"role": "user", "content": "Refactor this function to use async/await"}],
)Get your API key from your profile. Browse all available models (and their live pricing) on the models page.
Verdict
MegaBrain · free to start
Try a free AI coding agent in your terminal or your editor.
No card: the free models, your own API keys and local models with no limits from us. 90+ models on one plan from $8 a month.
npm install -g @getmegabrain/cliThen run megabrain in your project and sign in once.
Newsletter
Stay in the loop
Get our latest AI research and guides. No spam, unsubscribe anytime.