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ร through MegaBrain Gateway with no markup
- โ ๏ธ 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.
Pricing through MegaBrain Gateway
Both models are available on the MegaBrain Gateway with no markup โ you pay the provider rate. 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 Gateway
500+ models. One API. No markup.
Use in Claude Code, Cline, Cursor, or any coding agent.
Newsletter
Stay in the loop
Get the latest model comparisons and guides โ no spam, unsubscribe anytime.