Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.z.ai/llms.txt

Use this file to discover all available pages before exploring further.

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows — all through natural language commands.
Claude Code is even more powerful with the GLM Coding Plan— giving you 3× the usage at a fraction of the cost. Code faster, debug smarter, and manage workflows seamlessly with more tokens, and rock-solid reliability.
After successfully configuring the subscription, the default server model mapping is applied, where you see the Claude model in the interface but the GLM model is actually used.
You can manually adjust the model mapping (not recommended), see the “How to Switch the Model in Use” section in the FAQ for more details.

Step 1: Installing the Claude Code

Note: If MacOS users encounter permission issues during installation, please use nvm to install Nodejs.

Step 2: Config GLM Coding Plan

1

Get API Key

2

Configure Environment Variables

Set up environment variables using one of the following methods in the macOS Linux or Windows:
Note: Some commands show no output when setting environment variables — that’s normal as long as no errors appear.
Coding Tool Helper is a coding-tool companion that quickly loads GLM Coding Plan into your favorite Coding Tools. Install and run it, then follow the on-screen guidance to automatically install tools, configure plan, and manage MCP servers.
# Run Coding Tool Helper directly in the terminal
npx @z_ai/coding-helper
For more details, please refer to the Coding Tool Helper documentation.Description

Step 3: Start with Claude Code

Once the configuration is complete, you can start using Claude Code in your terminal or cmd:
cd your-project-directory
claude
If prompted with “Do you want to use this API key,” select “Yes.”
After launching, grant Claude Code permission to access files in your folder as shown below: Description
Once your plan has been configured successfully, server-side model mapping is enabled by default. This means that the interface may still display Claude models, while the actual models being used are GLM models.By default, Claude Code’s internal model environment variables are mapped to GLM models as follows:
  • ANTHROPIC_DEFAULT_OPUS_MODELGLM-4.7
  • ANTHROPIC_DEFAULT_SONNET_MODELGLM-4.7
  • ANTHROPIC_DEFAULT_HAIKU_MODELGLM-4.5-Air
To use GLM-5.1, add or replace the following environment variables in ~/.claude/settings.json:
{
    "env": {
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-4.5-air",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5-turbo",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.1"
}
}
GLM-5.1 and GLM-5-Turbo are premium models comparable to Claude Opus. Usage will be deducted from your quota at a 3× multiplier during peak hours and a 2× multiplier during off-peak hours.As a limited-time benefit, GLM-5.1 and GLM-5-Turbo will be deducted at only 1× during off-peak hours through the end of June. Note: “peak hours” refer to 14:00–18:00 daily (UTC+8).
You can use Claude Code for development Now!

FAQ

How to check which model is currently in use

Open a new terminal window and run claude to start Claude Code, enter /status to check the current model status. Description

Vision Search Reader MCP

Refer to the Vision MCP Server , Search MCP Server and Web Reader MCP Server documentation; once configured, you can use them in Claude Code.

Manual Configuration Not Work

If you manually modified the ~/.claude/settings.json configuration file but found the changes did not take effect, refer to the following troubleshooting steps.
  • Close all Claude Code windows, open a new command-line window, and run claude again to start.
  • If the issue persists, try deleting the ~/.claude/settings.json file and then reconfigure the environment variables; Claude Code will automatically generate a new configuration file.
  • Confirm that the JSON format of the configuration file is correct, check the variable names, and ensure there are no missing or extra commas; you can use an online JSON validator tool to check.
We recommend using the latest version of Claude Code. You can check the current version and upgrade with the following commands:
We have verified compatibility with Claude Code 2.0.14 and other versions.
# Check the current version
claude --version

2.0.14 (Claude Code)

# Upgrade to the latest
claude update