Back/Engineering/Cursor
IntermediateEngineeringCursor

How to Configure the Open-Weight GLM 5.2 Model in Cursor

A step-by-step guide to setting up the cost-effective GLM 5.2 AI model in your Cursor code editor using an Open Router API key, unlocking powerful, affordable AI assistance for your coding tasks.

How to Configure the Open-Weight GLM 5.2 Model in Cursor

Tools Used

Cursor

AI-first code editor

02Step-by-Step Guide
1

Get an Open Router API Key

Sign up for Open Router, add a credit card with a spending limit if needed, and generate a new API key to use for accessing various models.

2

Navigate to Cursor Model Settings

In the Cursor application, open the Settings menu and go to the 'Models' tab to manage your AI model configurations.

3

Add Open Router API Key

Find the 'API Keys' area and paste your API key from Open Router into the 'OpenAI API Key' field, then toggle it on.

4

Set the Custom Base URL

Toggle on 'Override OpenAI Base URL' and set it to https://openrouter.ai/api/v1/cursor. This specific URL is critical for the integration to work.

Pro Tip: The '/cursor' at the end of the URL is mandatory and was a piece of information the author had to hunt for.
5

Add the Custom Model

Click 'View all Models', select 'Add a custom model', and enter the model name zai/glm-5.2 to add it to your list of available models in the Cursor chat.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready