GLM-5.2 is Z.ai's latest flagship AI model, purpose-built for advanced coding, autonomous software development, and complex reasoning tasks. As the newest member of the GLM series, it introduces a massive 1 million-token context window, enabling deeper project understanding and more effective long-term task execution.
| Developer | Z.ai (Zhipu AI) |
|---|---|
| Model ID |
glm-5.2 glm-5.2[1m] |
| Release Date | June 13, 2026 |
| Context Window (default) | 202,752 tokens (~203K) |
| Context Window (extended) | 1,000,000 tokens — use glm-5.2[1m] model ID |
| Max Output Tokens | 131,072 |
| Architecture (family) | MoE (Mixture of Experts), 744B total parameters in GLM-5 base |
| Training Hardware | Huawei Ascend (non-NVIDIA) |
| Training Algorithm | Asynchronous Agent RL for long-chain stability |
| Thinking Modes | High Max (effort switchable via /effort in Claude Code) |
| Modalities | Text (input and output) |
| Languages Evaluated | 9+ programming languages across 10,000+ test environments |
The headline is the context window, but that number is only meaningful if the model can actually use it. Here's what distinguishes GLM-5.2 from both its predecessors and the wider field of coding-focused models.
Z.ai specifically qualifies this as "usable" — not just formally accepted. The model is designed to maintain coherent understanding across the full length, which matters when you drop an entire monorepo in at once. That's a 5× jump from GLM-5.1's 200K window.
A new training algorithm developed specifically for stability on long reasoning and action chains. Where models can drift or lose track of earlier context in extended agentic sessions, the async RL approach is designed to keep execution coherent over hundreds of tool calls.
GLM-5.2 simplifies effort control to two modes: High and Max. Standard tasks default to High; for the most complex refactors and architecture decisions, Max unlocks deeper reasoning. Z.ai recommends Max for demanding coding work.
Evaluated against 10,000+ verifiable environments and nine programming languages. Demonstrated tasks include building a Chrome extension from scratch and migrating a three-year-old legacy React project fully to TypeScript — not as assisted completion, but as autonomous execution.
Works out of the box with Claude Code, OpenClaw, Cline, Roo Code, and Kilo Code via environment variable overrides. No custom harness required — a few lines in your config file and the model is live in your existing workflow.
Not every task benefits equally from a model built specifically for extended, autonomous engineering work. These are the scenarios where GLM-5.2's design choices pay off most visibly.
With a million-token context window, you can drop an entire production codebase into a single session and ask the model to migrate it — framework by framework, dependency by dependency. Z.ai demonstrated this with a full React-to-TypeScript migration of a three-year-old legacy project, running autonomously from start to working state.
The Asynchronous Agent RL training specifically targets stability across multi-hundred-step sequences with thousands of tool calls. If your workflow involves an AI agent that runs for hours, making incremental code edits, running tests, and fixing failures in a loop, GLM-5.2 is one of the few models explicitly optimized for that pattern.
GLM-5.2 has been demonstrated building a fully functional Chrome extension from scratch — spec to working artifact in a single autonomous session. For teams that want to prototype fast, the combination of broad context and deep code generation capability reduces the number of back-and-forth iterations needed to reach something testable.
The MIT license makes GLM-5.2 one of the most permissive frontier-class coding models available. Teams with data residency requirements or budget constraints around per-token costs can run the weights on their own infrastructure using vLLM or SGLang, without any licensing friction.
Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.
GLM-5.2 is documented as suited for long-horizon autonomous coding and engineering tasks, including completing a full development workflow from requirements to multi-platform deployment in one task.
It is also suited for cross-file, multi-step, long-chain software work such as testing module decoupling, interface migration, directory cleanup, SDK adaptation, and cross-language refactoring.
The model is documented for mobile app development scenarios, where it can cover client architecture, streaming messages, long connections, local state management, keyboard behavior, scrolling logic, system notifications, permissions, and background recovery.
It is also documented for small-program development, including page subdivision, custom components, page stack management, request wrapping, authentication state maintenance, lifecycle management, and handling abnormal states.
import requests r = requests.post( "https://api.aimlapi.com/v1/chat/completions", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "zhipu/glm-5.2", "messages": [ { "role": "user", "content": "Hello!" } ] }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/chat/completions", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "zhipu/glm-5.2", "messages": [ { "role": "user", "content": "Hello!" } ] }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/chat/completions \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"zhipu/glm-5.2","messages":[{"role":"user","content":"Hello!"}]}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
| Cached input |
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| Intelligence | 34 | Composite score across standardised reasoning, knowledge and problem-solving evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| Coding | 68.8 | Composite score across standardised coding evaluations, measured independently by Artificial Analysis | Source | September 12, 2026 |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
GLM-5.2 This page | Coding + agents | |||
| Reasoning + agents | ||||
| Balanced coding + agents | ||||
| Long-context, multimodal & agentic workflows | ||||
| Reasoning + agents |
GLM-5.2 has a 1,000,000 tokens context window and can return up to 131,072 tokens.
GLM-5.2 takes text as input and returns text.
Use zhipu/glm-5.2 as the model id. Requests go to https://api.aimlapi.com/v1/chat/completions.
GLM-5.2 became available on June 16, 2026.
GLM-5.2 is priced at input $1.82 / 1M tokens, output $5.72 / 1M tokens, cached input $0.338 / 1M tokens.
Yes, GLM-5.2 can stream responses as they are generated.
GLM-5.2 was built by Zhipu AI.