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.

1. Installing the Claude Code

Getting started with Claude Code is incredibly simple. All you need is Cursor and Node.js 18+ installed on your system. Step 1: Open Cursor and enter the following command in the chat input:
https://docs.anthropic.com/zh-CN/docs/claude-code/overview Help me install Claude Code
This will guide Cursor to help set up Claude Code for you. Step 2: Resources

2. Use Claude Code with GLM-4.5

1. Obtain Your Z.AI API Key

Visit Z.AI to get your API Key

2. Configure Environment Variables

After installing Claude Code, set up environment variables using one of the following two methods by enter the following commands in the Mac OS terminal or Windows cmd:
Note: When setting environment variables, the terminal will not return any output. This is normal, as long as no error message appears, the configuration has been applied successfully.
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://open.bigmodel.cn/api/anthropic"
export ANTHROPIC_AUTH_TOKEN="your Zhipu API key"

3. Quick 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 You can now use Claude Code for development!
Claude Code comes with two model environment variables:
  • ANTHROPIC_MODEL: Uses GLM-4.5 (recommended for dialogue, planning, coding, and complex reasoning).
  • ANTHROPIC_SMALL_FAST_MODEL: Uses GLM-4.5-Air (recommended for file search, syntax checking, and other auxiliary tasks).
This setup strikes a balance between performance and speed, and is our recommended configuration. Other models (e.g. GLM-4.5-X, GLM-4.5-AirX, GLM-4.5-Flash) are not supported at this time.

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"
  }
}