How to set up GLM 5.2
Greg Isenberg ·2026-06-23 ·2 min read
Summary written by us from the video's transcript. The video, and everything in it, is Greg Isenberg's work.
Learn how to set up and use the open‑source GLM 5.2 model locally or via cloud providers, compare its performance, and apply model chaining for cost‑effective AI workflows.
Takeaways
- GLM 5.2’s large context window and strong benchmark scores make it competitive with leading closed‑source models.
- You can connect GLM 5.2 to Cursor by swapping the OpenAI key for a Z AI key and overriding the endpoint, then adding a custom model entry.
- OpenRouter lets you run GLM 5.2 in the cloud without buying high‑end hardware; token costs are significantly lower than with Opus 4.8.
- Model chaining—using a vision‑capable model to preprocess images and GLM 5.2 for planning—circumvents its current limitations while staying cost‑effective.
- For sustained heavy usage, investing in local GPU hardware may pay off long‑term, but most users can start today with cloud APIs and minimal setup.
What makes GLM 5.2 notable
GLM 5.2 offers a 1 million token context window and scores 81 on the Terminal Bench 2.1 benchmark—only four points behind Opus 4.8. It performs well on long‑horizon tasks, making it suitable for planning‑heavy prompts.
Because it is open source you can run it on a capable local machine or access it through cloud providers such as OpenRouter, which often charge less per token than closed‑source APIs.
Comparing GLM 5.2 to other models
Benchmarks show GLM 5.2 at 62.1% versus Opus 4.8’s 69.2%, indicating strong but not top‑tier performance. In practice the author found GLM 5.2 more refined for front‑end design tasks than earlier local models.
The speaker emphasizes that benchmarks are a starting point; real value is judged by building and testing prompts directly against the model.
Setting up GLM 5.2 with Cursor
1. Obtain an API key from Z AI (the provider of GLM 5.2).
2. In Cursor settings replace the OpenAI key with your Z AI key.
3. Override the OpenAI endpoint with the Z AI endpoint URL provided by the service.
4. Add a custom model entry named “GLM 5.2” and select it for chat completions.
Using GLM 5.2 via OpenRouter or Codex
For OpenRouter: get an OpenRouter API key, copy its endpoint into your tool’s provider settings, then create a profile in Codex (or another IDE) that points to the custom model, specifying context window size.
Codex supports open‑source models, so you can switch to GLM 5.2 from the CLI once the profile is configured.
Model chaining to overcome limitations
GLM 5.2 lacks vision capabilities. The workflow demonstrated uses Opus 4.8 (or another vision‑enabled model) to describe screenshots, then passes that description to GLM 5.2 for planning and execution.
By sequencing a stronger reasoning model with a cheaper execution model you keep token costs low while still getting high‑quality output.
Cost considerations and hardware trade‑offs
Running GLM 5.2 locally avoids token charges but requires expensive GPU memory; many consumer machines cannot host the model, so cloud access via OpenRouter is often simpler.
Token cost example: 50 k input + 85 k output tokens cost ~44¢ with GLM 5.2 versus $2.38 with Opus 4.8—a roughly 5× savings that adds up for heavy usage.