GLM Coding Plan — designed for Claude Code users, starting at $3/month to enjoy a premium coding experience!
Z.AI’s GLM-4.5 models can be integrated with Claude Code through an Anthropic API-compatible endpoint. This allows Claude Code to communicate with GLM-4.5 without requiring any code modifications to Claude Code itself.

Step 1: Obtain Your Z.AI API Key

Visit Z.AI to get your API Key

Step 2: Configure Environment Variables

After installing Claude Code, set up environment variables using one of the following two methods: Method 1: Using a Script (Recommended for First-Time Users)
curl -O "http://bigmodel-us3-prod-marketplace.cn-wlcb.ufileos.com/1753683755292-30b3431f487b4cc1863e57a81d78e289.sh?ufileattname=claude_code_prod_zai.sh"
Method 2: Manual Configuration
export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic

export ANTHROPIC_AUTH_TOKEN=YOUR_API_KEY 

Step 3: Quick Start with Claude Code

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 You can now use Claude Code for development! Mark: Claude Code has two internal model environment variables. The ANTHROPIC_MODEL (main model) uses GLM-4.5 (for scenarios such as dialogue, planning, coding, and complex reasoning), while ANTHROPIC_SMALL_FAST_MODEL uses GLM-4.5-Air (for auxiliary scenarios such as file search and syntax checking). This is also our recommended usage, as it balances performance, speed, and cost. Other models (e.g., GLM-4.5-X / AirX / Flash) are not currently supported.

Additional Instructions: How to Switch the Model in Use

Currently, switching to other models is not supported.
  1. Configure ~/.claude/settings.json with the following content:
{
  "env": {
      "ANTHROPIC_MODEL": "glm-4.5-air"
  }
}
  1. Open a new terminal window and run claude to start Claude Code.
  2. In Claude Code, enter /status to check the current model status.
claude-code
  1. To switch back to the GLM-4.5 model, modify ~/.claude/settings.json as follows:
{
  "env": {
      "ANTHROPIC_MODEL": "glm-4.5"
  }
}