GLM-5.2 on OpenRouter & BigModel: Zhipu's 1M-Context Coding Agent with 128K Output

Zhipu GLM-5.2 is now accessible through OpenRouter, BigModel API, and DashScope: 1M-token lossless context, 128K max output, reasoning_effort, context caching, and FrontierSWE-class performance for long-horizon coding-agent routing.

TheRouter Newsroomvia Zhipu AI / BigModel
Editorial graphic showing a long-horizon code project ingested into a single 1M-token context window with routing branch indicators

Access summary: GLM-5.2 is available on OpenRouter at $0.95 / M input tokens and $3 / M output tokens, through BigModel API (open.bigmodel.cn), and via Alibaba Cloud DashScope — the same base URL used for Qwen3, DeepSeek, and Kimi on TheRouter. API TPS on the hosted endpoint is competitive with Opus 4.8 for standard coding tasks; local inference benchmarks from the community show ~9–10 t/s on consumer hardware. Routing teams comparing "GLM-5.2 on OpenRouter" vs. "GLM-5.2 on TheRouter" get identical model weights — the difference is billing consolidation, fallback routing, and team governance.


The constraint that ends most long-horizon coding agent sessions is not model quality — it is context exhaustion. A model can write good code at turn 3 and generate broken code at turn 47 because architectural decisions, interface contracts, and directory conventions fell out of the active context window. GLM-5.2, Zhipu AI's new flagship, is built around a single claim that directly affects this failure mode: a verified, lossless 1M-token context window trained specifically for multi-session coding agent workloads — not just extended for marketing purposes.

What happened

Zhipu AI released GLM-5.2 as its new flagship text model, succeeding GLM-5.1-highspeed. The model is now live on:

  • BigModel API (open.bigmodel.cn/api/paas/v4/) with model ID glm-5.2
  • Alibaba Cloud DashScope third-party model catalog as glm-5.2
  • OpenRouter as z-ai/glm-5.2 (perma-slug z-ai/glm-5.2-20260616), giving teams already using OpenRouter a low-friction test path before direct BigModel or DashScope onboarding

Core specs:

PropertyGLM-5.2
Context window1,000,000 tokens (verified lossless)
Max output tokens128,000
Thinking modeYes (multiple levels, reasoning_effort param)
Function callingYes
Context cachingYes
Structured outputYes (JSON mode)
MCPYes
StreamingYes (SSE)
OpenRouter pricing$0.95 / M input · $3 / M output
API TPS (hosted)Competitive with Opus 4.8; community local: ~9–10 t/s

The model was pre-released to GLM Coding Plan enterprise users before general availability. Benchmark performance: on FrontierSWE (long-horizon software engineering tasks), GLM-5.2 falls approximately 1% behind Claude Opus 4.8 while outperforming both GPT-5.5 (by ~1%) and Claude Opus 4.7 (by ~11%). On SWE-Marathon (harder extended-horizon evaluation), it trails Opus 4.8 by ~13%. On Code Arena — a large-scale blind evaluation by frontend developers — GLM-5.2 ranked first across all globally available models.

GLM-5.2 claims to have processed over 850K tokens in a single live coding session — completing the full design, frontend/backend implementation, testing, and deployment of a multi-platform application from a single continuous agent run.

Provider benchmarks: TPS, latency, and pricing

Artificial Analysis has benchmarked GLM-5.2 across 13 API providers. Key findings (as of late June 2026):

MetricTop providerValue
Output speed (fastest)Baseten266.2 t/s
Output speed (#2)CoreWeave204.7 t/s
Output speed (#3)Databricks200.8 t/s
Lowest latency (TTFT)Baseten8.38 s
Lowest price (blended)GMI (FP8)$0.72 / 1M tokens
Lowest price (#2)Wafer$0.79 / 1M tokens
Lowest price (#3)DeepInfra (FP8)$0.80 / 1M tokens

Full provider list: Baseten, CoreWeave, Databricks, Makora (FP8), FriendliAI, Fireworks, Together AI, Novita (FP8), GMI (FP8), DeepInfra (FP8), SiliconFlow (FP8), Wafer, Parasail (FP8).

Speed varies ~72% between fastest and slowest provider — routing teams should pin to a preferred provider or implement provider-level latency fallbacks rather than relying on OpenRouter's default routing when TPS matters for agent throughput.

For teams accessing GLM-5.2 through OpenRouter, the model ID is z-ai/glm-5.2. Reasoning efforts high and xhigh are supported on OpenRouter; xhigh maps to max reasoning.

Why it matters for AI engineering teams

Solid 1M is not the same as nominal 1M. Several frontier models now advertise 1M-token context windows, but performance typically degrades significantly beyond 200K–300K tokens: the model "reads" the early context but makes decisions as if it forgot it. Zhipu's specific claim for GLM-5.2 is "Solid 1M" — lossless retention trained on real engineering workloads. The 850K-token live demo is a concrete operational data point, not a synthetic benchmark. For teams that have been burned by context degradation in long agent runs, this is the threshold claim that determines whether a model belongs in the long-horizon routing tier.

128K max output enables one-shot large deliverables. GLM-5.1-highspeed had 128K max output; GLM-5.2 inherits this and pairs it with the 1M context. The practical consequence: a model can read a full project repository at 200K–400K tokens, then emit a 100K+ token implementation artifact — frontend code, API layer, tests, config — in a single inference call. This is architecturally different from models capped at 8K or 32K output, which require decomposition strategies and multiple round-trips.

FrontierSWE-class performance is now open-access. GLM-5.2 is the highest-ranked open-model on FrontierSWE, placing within 1% of Opus 4.8. For teams that currently use Opus 4.8 as their quality ceiling for long-horizon coding, GLM-5.2 offers a viable open-model alternative at a different price tier — routable through existing DashScope or BigModel API access.

DashScope distribution expands access without new credentials. Teams that already route domestic models through Alibaba Cloud DashScope can add glm-5.2 to their routing policy through the same OpenAI-compatible base URL and API key. This is the same single-endpoint access pattern available for Qwen3.7-Max, DeepSeek V4, Kimi K2, and MiMo-V2.5-Pro — adding GLM-5.2 requires no new vendor onboarding.

The router/operator angle

Design a long-horizon tier in your routing policy. Most routing tables today optimize on three dimensions: cost (flash vs. full models), speed (throughput-optimized variants), and availability (primary + fallback). A missing fourth dimension is horizon length — whether the routing target can maintain coherent multi-turn agent behavior over 100K+ token contexts.

A four-tier structure that accounts for this:

  1. Short interactive tasks (< 32K context, real-time): Flash/mini models for speed and cost
  2. Single-turn long outputs (< 200K context, one-shot): Frontier models with high output limits
  3. Long-horizon agent sessions (> 300K context, multi-turn): Models with verified solid-context behavior — GLM-5.2 is now a candidate here alongside Gemini 3.5 Pro and Opus 4.8
  4. Fallback / reliability tier: Secondary providers for any tier when primary is degraded

If you currently route all coding agent tasks to a single frontier model regardless of session length, you are likely under-routing short tasks (paying flagship prices for 4K-turn interactions) and over-routing long tasks (hitting context degradation silently without failover).

Context caching changes the cost arithmetic for long sessions. GLM-5.2 supports context caching — a feature that is critical when you are loading the same 200K-token codebase at the start of every agent turn. Without caching, a 10-turn agent session over a 200K-token repo costs 2M input tokens in redundant prefix processing. With caching, the prefix is computed once and reused. Teams evaluating GLM-5.2 for long-horizon routing should factor caching hit rates into their cost model before comparing raw per-token pricing against uncached alternatives.

Thinking mode adds a reasoning-effort lever. GLM-5.2 exposes reasoning_effort as a parameter (values: low, medium, max, with thinking.type: "enabled"). This is the same pattern exposed by Anthropic's extended thinking and Qwen's thinking mode — allowing routing layers to escalate reasoning depth per call rather than switching to a separate model. For agentic frameworks that need to make planning decisions, this matters: you can set low reasoning effort for exploratory file reads and max effort for architecture decisions, all within the same model endpoint.

What TheRouter users should watch or try

GLM-5.2 is now reachable through DashScope's OpenAI-compatible API — the same access path used for domestic Chinese models already available on TheRouter. Teams using TheRouter for domestic AI provider routing can evaluate GLM-5.2 by testing it in a long-horizon coding scenario:

  • Load a full project repository into context (target 100K–400K tokens)
  • Issue a multi-step refactoring or cross-file architecture task in a single prompt
  • Compare context coherence at turns 5, 10, and 20 against your current long-horizon model

Check Artificial Analysis for live provider TPS and pricing comparisons across the full 13-provider list. For OpenRouter access, use model ID z-ai/glm-5.2; BigModel API users route to open.bigmodel.cn/api/paas/v4/ with model ID glm-5.2; DashScope users add glm-5.2 to existing routing via the OpenAI-compatible base URL.

Models covered in this article

Customer Support