groundy
developer tools

Running GLM-5.2 in Cursor, Cline, and Roo Code: Migration Checklist and Gotchas

GLM-5.2 supports an Anthropic-compatible endpoint, letting Cursor, Cline, Roo Code, and five other coding agents swap in the 753B MoE model with a base-URL change.

6 min · · · 6 sources ↓

GLM-5.2 launched on June 13, 2026 with an Anthropic Messages API-compatible endpoint,3 which means switching a Claude Code, Cline, or Roo Code setup does not require a new SDK or a rewrite of agent configuration. A base URL swap and a model-name change are the mechanical steps. Everything else is a question of tradeoffs, which are worth examining before the swap, not after.

What is GLM-5.2 and what changed from prior generations?

GLM-5.2 is Zhipu AI’s latest coding-focused model, released under the Z.ai brand.1 It is a 753B-parameter Mixture-of-Experts model2 with approximately 40B active parameters per token implied by the 744B-A40B designation in the official README.1 The architecture uses IndexShare sparse attention, which reuses the same attention indexer across every four sparse layers, reducing per-token FLOPs by 2.9x at 1M context length.2 A Multi-Token Prediction speculative decoding layer is also present.2

The numbers that matter for the coding-agent comparison:

MetricGLM-5.2GLM-5.1 (prior gen)
SWE-bench Pro62.1%158.4%1
Terminal-Bench 2.181.0162.01
Context window1M tokens1200K tokens1
Max output128K tokens (131,072)3

Claude Opus 4.8 scores 85.0 on Terminal-Bench 2.1,1 four points ahead of GLM-5.2’s 81.0. That gap is relevant for terminal-heavy workflows. For AIME 2026 GLM-5.2 reports 99.2,1 HMMT Nov 2025 at 94.4,1 and GPQA-Diamond at 91.2.1 These are Zhipu’s own published numbers; independent verification has not appeared as of June 19, 2026.

The context window increase from 200K to 1M tokens1 is the single largest architectural change for agent use. It means full-repository ingestion in a single pass is feasible for codebases that previously required chunking. Whether the model holds coherent retrieval and reasoning at token counts well above 200K has not been validated by an independent long-context eval.

MIT-licensed weights are downloadable now at BF162 and FP82 precision. The FP8 variant had accumulated roughly 93,900 downloads against 11,900 for BF16 as of June 19, 2026,2 a ratio that reflects the hardware cost reality of running a 753B model in production.

Which coding agents support GLM-5.2 at launch?

Eight agents ship official GLM-5.2 integration as of the June 13 launch:4 Claude Code, Cline, OpenCode, Roo Code, Goose, Crush, OpenClaw, and Kilo Code. All eight route through Z.ai’s Anthropic-compatible API,6 so the integration pattern is uniform across agents that already have Anthropic client support.

Cursor is not listed in Z.ai’s published eight-agent launch set.4 Any Cursor user migrating to GLM-5.2 would do so through Cursor’s custom model or OpenAI-compatible endpoint configuration, not through a Z.ai first-party integration. That path exists, but it has no official support from either side at launch.

How do you migrate from Claude Opus to GLM-5.2 in Cline, Roo Code, or Claude Code?

The base URL for Z.ai’s Anthropic-compatible endpoint is the single required change.6 The pattern applies to any agent that uses the Anthropic Messages API client:

  1. Base URL. Replace Anthropic’s endpoint with Z.ai’s Anthropic-compatible URL. Zhipu’s model overview documentation6 specifies this endpoint; the exact string is in their official docs rather than reproduced here to avoid stale copy.
  2. Model name. Set the model identifier to glm-5.2 or glm-5.2[1m] for the 1M-context variant.3 Do not carry over claude-opus-4-8 or any Anthropic model string; it will 404.
  3. API key. The Z.ai API key replaces the Anthropic API key. If the agent stores credentials per-provider (Claude Code and Cline both do), create a new provider entry rather than overwriting the Anthropic key. Keeping both lets you switch back without re-entering credentials.
  4. Thinking presets. GLM-5.2 exposes High and Max thinking-effort presets for long multi-step coding tasks.3 These are not Anthropic extended thinking and may behave differently on tasks tuned for Anthropic’s budget_tokens parameter. Test on a representative task before committing to Max on long agentic sessions.
  5. Context size. The 1M-token window1 is an upper bound, not a floor. Agents that batch large context windows by default will send more tokens per turn, which draws from the Z.ai subscription allowance faster than the same task would against per-token Anthropic billing.

What gotchas appear at the integration boundary?

Subscription vs. token billing mismatch. Z.ai prices GLM-5.2 through flat-tier subscriptions:4 Lite at $18/month (approximately 400 prompts per week), Pro at 5x that usage, Max at 20x (approximately $112/month yearly). There are no per-token charges under this model. For a developer accustomed to Anthropic’s per-token billing, “prompts per week” is a coarser unit. A single 1M-token context pass counts as one prompt against the weekly allowance; a sequence of short tool-call loops counts as many prompts. The Lite tier can drain in a few heavy agentic sessions.

MIT-licensed self-hosting is not free. The BF16 weights2 require hardware that can run a 753B-parameter model at inference speed. That is not a consumer GPU workload. Deployment is supported via SGLang, vLLM, Transformers, and KTransformers.1 The MIT license removes royalty cost but not infrastructure cost. FP8 quantization2 reduces memory requirements substantially, which is why the FP8 download count is running nearly 8x BF16.

Benchmark attribution. The 62.1% SWE-bench Pro and 81.0 Terminal-Bench 2.1 numbers are Zhipu-published and appear in the official GitHub repository.1 They are not yet independently replicated. The 77.8% SWE-bench Verified figure in wider circulation belongs to GLM-5 base (February 2026), a different model. Attributing that number to GLM-5.2 is an error present in some community migration guides.

The Opus 4.8 Terminal-Bench gap. Claude Opus 4.8 scores 85.0 on Terminal-Bench 2.1 against GLM-5.2’s 81.0.1 For workflows that are terminal-execution-heavy, agentic bash chains, shell testing, CI debugging, this four-point spread may be measurable in practice. For pure code-generation tasks the SWE-bench Pro comparison (62.1% for GLM-5.2) is more relevant, and no current Opus 4.8 SWE-bench Pro number is published in the Z.ai README for a direct apples-to-apples comparison.

Company and supply chain. Zhipu AI is a 2019 Tsinghua University KEG lab spin-off,5 publicly listed in Hong Kong as 02513.HK after its January 2026 IPO.5 The model is developed and served from China. Teams with data residency requirements or geopolitical supply-chain policies should review those requirements before routing production coding-agent traffic through Z.ai’s hosted endpoint. The MIT weight path avoids this by allowing self-hosting outside Z.ai’s infrastructure.

Why would you switch, and why might you stay on Anthropic?

The case for switching is pricing structure and context window. A flat $18/month Lite subscription4 against a budget of roughly 400 prompts per week is straightforward for a solo developer doing bounded coding sessions. The 1M-token window1 lets full-repository context pass in a single call, which Anthropic’s current per-token pricing makes expensive for large-context workloads.

The case for staying on Anthropic is benchmark verification and tooling maturity. Claude Opus 4.8 leads GLM-5.2 by four points on Terminal-Bench 2.1.1 The Anthropic ecosystem, extended thinking, tool-use schemas, computer-use, has years of production validation. Claude Code and Cline configurations against Anthropic endpoints are well-documented and stable. GLM-5.2 is a June 2026 release; the integration surface for the eight listed agents4 will accumulate edge cases over the next few weeks that are not yet documented.

A reasonable migration path is parallel: keep the Anthropic key active, add Z.ai as a second provider in whichever agent you use, and run a two-week comparison on representative tasks before switching the primary model. The Anthropic-compatible endpoint6 makes that comparison low-friction. The flat-tier pricing4 makes the two-week trial period cost-bounded.

Frequently Asked Questions

Does switching to GLM-5.2 require changing the agent’s SDK?

No. Z.ai’s endpoint is Anthropic Messages API-compatible,6 so agents using the standard Anthropic client library swap over with a base URL and model-name change. No new SDK dependency is required.

Is the 1M-token context available on all Z.ai subscription tiers?

The 1,000,000-token context window is a model-level property of GLM-5.21 accessible via the glm-5.2[1m] model identifier.3 All three subscription tiers (Lite, Pro, Max)4 route to the same model. The difference between tiers is weekly prompt volume, not context size.

Can I self-host GLM-5.2 instead of paying the Z.ai subscription?

MIT-licensed weights are publicly available at BF162 and FP82 precision. Supported deployment frameworks are SGLang, vLLM, Transformers, and KTransformers.1 Self-hosting removes the per-tier subscription cost, but running a 753B-parameter model requires substantial GPU or NPU capacity. The FP8 variant is the practical path for teams that do not have enough VRAM for BF16.

What is the parameter count: 744B or 753B?

Zhipu’s own HuggingFace model cards state 753B.2 The 744B figure was a community-circulated estimate that predated the official weight release. Use 753B when citing the model in documentation or architecture reviews.

sources · 6 cited

  1. GLM-5 GitHub Repository: Benchmarks and Architecture primary accessed 2026-06-19
  2. GLM-5.2 HuggingFace Model Card (BF16) primary accessed 2026-06-19
  3. Zhipu GLM-5.2 Official API Documentation primary accessed 2026-06-19
  4. GLM Coding Plan Pricing (Z.ai) primary accessed 2026-06-19
  5. Z.ai Chatbot powered by GLM-5.2 primary accessed 2026-06-19
  6. Zhipu AI Model Overview (Anthropic-compatible endpoint) primary accessed 2026-06-19