← Video library

How to Set Up GLM-5.2 in Cursor (Cheaper Than Claude)

Connect Cursor to Z.ai’s model endpoint, then assign one model to execute a task and another to review it.

Watch on YouTube ↗

Follow the walkthrough

  1. 1. Create the provider key

    Set up billing in the Z.ai account you intend to use, then create its API key.

    Watch at 00:00:41
  2. 2. Point Cursor at the provider

    In the recorded Cursor settings, open Models and API Keys. Enter the Z.ai key under the OpenAI-compatible override and set the base URL to the provider’s compatible endpoint.

    Watch at 00:01:00
  3. 3. Register the model

    Open the model list and add the custom model ID. The video description spells the name GLM-5.2.

    Watch at 00:01:25
  4. 4. Divide execution and review

    Give GLM the implementation task and have a second model review the result. For a visual task, Amir describes using an image-capable model to turn the screenshot into a text brief first.

    Watch at 00:01:59

Keep the task and review criteria fixed when comparing two model sequences.

The exact base URL appears on screen. Confirm the current endpoint and model ID with the provider. Prices and benchmark comparisons in the recording are historical.

Read the transcript

All right, I'm officially local on maxing. Basically, been testing out with GLM 5.2. In the next 5 to 10 minutes, I'm going to quickly show you how to get set up with it using cursor and potentially open router as well, and kind of how it's been stacking up and how I'm personally using GLM 5.2 with other LLMs to kind of fusion model and do a little bit of sequencing. So, 5.2 came out. It scores quite well on kind of the benchmarks

across like Opus 4.8, just a couple points behind um 4.8. Now, to me personally, like these benchmarks are great, but I really don't understand it until I actually like play around with it. And just also thinking about like how we can actually apply this. So, I want to quickly show you how to get actually set up with it. So, you can go to ZAI and just set up an API key, obviously once you get your billing in place.

And then, when you've gone ahead and done that, um what you're going to do is go into You can obviously use this with Codex as well, and you can use ZAI directly or open router. Um what you're going to do is go into the settings for cursor, and then once you go into settings, you're going to go into models. Uh you're going to do API keys. You're going to override the OpenAI API key with the GLM 5.2 API key that you got

from the ZAI dashboard. And then you're going to override the base URL with this one right here. So, um maybe what I'll do is I'll publish the the cursor canvas that I have or just have some uh a link to where you can go through this full setup process. One Once I have Once you've gone ahead and done that, you're going to go to view models and add a custom model. You're going to call it exactly uh what I have right here, which

is GLM 5.2. And then the what model is going to start working. So, um how does this all work? Basically, we've gone through the setup process. We can see the benchmarks are quite well. I'm personally using it in a very different way. So, I'm looking at it like, "Okay, cool." Um this is a long horizon. Like it's able to do long horizon tasks. So, it can run for open an hours. It has the same capabilities and thinking of 4.8.

How I'm personally using it is uh doing a specific task with 5.2 and then getting 4.8 to review it or coming up with a plan with uh 5.2 and then getting 2.5 to execute on it. So, there's different ways you can chain and sequence this and that's exactly what I'm doing. Um what I'm looking at it is, okay, based on the input and output, how can I maximize token usage? Um using GLM 5.2. Now, why is this

important? Because one, it's open source. It's a local model you can run locally. I don't have the compute or the equipment to be able to run this locally. So, I'm using something like the API directly or I'm going with open router and I can also tap into different models if I wanted to with open router. So, um part of it is uh essentially being able to kind of use a sequencing between these different API uh API different LLM models to get the best

output. The biggest challenge here is that with uh 5.2, you're not getting um the image capabilities or the modality or multi-modality that it has. So, for me personally, it's looking at, okay, like um how can I for example use 4.8 to input an image in this instance? Like, I'll be like, okay, cool. Why don't I drop this here and go into the chat. I'll switch to 4.8 and I'll say, "Explain in detail what you see in the front end and how you would improve the

UI, right? And then what I'll do is I'll switch back to 5.2 to then take like what it's translated from the front end based on the text and then get get it to actually improve it. This kind of goes back in time when we were like when it when we didn't have vision capabilities and we were like explaining certain things with certain models. So, the same instance here, I'm going to use 4.8 to explain it or even 2.5 for example, composer 2.5, and then switch to GLM 5.2

to then execute on it. So, just to recap, the The process is pretty straightforward. You can actually either use the API key directly, you can set up in CodeX, or you can use OpenRouter. For example, like I I use that Z Z AI API key, but you can also go to OpenRouter, set it up through there. You can just select a model, get your you know, select a model, and then from there you can go ahead and you know,

get grab your API key through here. So, I have one for example, and then you can plug it into CodeX or Cursor, and then use that specific model since OpenRouter supports all kinds of models. Anyways, so it's a very very quick breakdown. I hope it's helpful. Play around with it. Let me know what you think. I'm personally playing around with it. I actually like it. I think it's it's getting there. It's definitely getting there. I've been using it to

like design a front end here, and it's getting pretty good results. Obviously, there is some vibe code and slop, but you can kind of get through that and refine it accordingly. Let me know. Thanks.

Download as text