Skip to main content
GLM-5.2 Now Live
The GLM Coding Plan now supports the latest GLM-5.2 model for all users (Max, Pro, and Lite), and you can switch between models within your preferred Coding Agent.

Before You Start

This is a model-switching guide for existing GLM Coding Plan users—not an onboarding tutorial. Make sure you have already:
  1. Active GLM Coding Plan subscription and a valid Z.AI API key.
  2. Configured the correct endpoint for your tool:
    • Claude Code / Goose (Anthropic-compatible): https://api.z.ai/api/anthropic
    • Other OpenAI-compatible tools: https://api.z.ai/api/coding/paas/v4
  3. Verified that your tool can successfully call an existing GLM model (for example, glm-4.7). If a basic call fails, please resolve that first.

Switching Models in Claude Code

Step 1: Update the default configuration

  • Method 1: In the terminal, run vim ~/.claude/settings.json to open and edit the file. When you’re done, press Esc, type :wq, and save your changes.
  • Method 2: In Finder, choose Go → Go to Folder, then enter ~/.claude/settings.json to locate and edit the configuration file.
To use GLM-5.2, add or replace the following environment variables in settings.json. Do not replace the entire file if it already contains other fields —only add or update the keys shown below.

Enable 1M Context

To enable GLM 1M context, add the [1m] suffix to the model name (e.g., glm-5.2[1m]) and configure the compression window size parameter "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000". If Claude Code reports that the model with the [1m] suffix does not exist, please upgrade Claude Code to the latest version and try again.

Switch Effort (Thinking Intensity)

In a Claude Code session, type the /effort command to switch thinking intensity. After switching, Claude Code maps the selected effort to GLM-5.2’s actual effort as follows:
For coding tasks, we recommend switching to max effort for deeper reasoning and more stable complex task performance.

Step 2: Confirm that the model has been switched

Open a terminal and run claude, then type /status. Verify:
  1. Settings source shows your ~/.claude/settings.json.
  2. Model shows glm-5.2 or glm-5.2[1m].
Description

Switching Models in Other Tools

This currently only works with coding agents that support custom model configuration. If your agent tool does not allow custom model settings, you will need to wait for official support in a future release.

Using Cline as an example:

Please use the following settings:
  • API Provider:Select OpenAI Compatible
  • Base URL:Enter https://api.z.ai/api/coding/paas/v4
  • API Key:Enter your Z.AI API key
  • Model:Choose Custom Model and enter the model name, such as glm-5.2
  • Other settings:
    • Uncheck Support Images
    • Set Context Window Size to 1000000
    • Adjust temperature and any other parameters based on your task requirements
Description