Model guidesAdvanced usersUpdated

How to use GLM-5.3 with Claude Code

Set your I Code Easy API Key, the root URL https://api.icodeeasy.cc, and model glm-5.3 in Claude Code to use GLM-5.3 through this service. This guide covers macOS, Linux, Windows, verification, and common errors.

Model and client are different

GLM-5.3 is the model; Claude Code is Anthropic’s coding client. Running Claude Code does not mean a Claude model must handle the request: this configuration selects GLM-5.3. Use an I Code Easy Key and URL here, rather than a Zhipu Key, Coding Plan subscription, or official Zhipu endpoint.

Before you start

  1. If the client is not installed, follow the Claude Code installation guide first, then return here. Follow Anthropic’s current instructions for Windows terminals and Git Bash requirements.
  2. Register and copy your service Key from API Keys. Select an applicable endpoint as described in Getting started.
  3. Check current prices on the pricing page and supported features in the model capability catalog. Official Coding Plan prices and quotas do not describe this service.
  4. Keep the Key in your local configuration. Do not put it in a repository, screenshot, chat, or support ticket.

Configuration reference

VariableValue / purpose
ANTHROPIC_AUTH_TOKENYour I Code Easy API Key
ANTHROPIC_BASE_URLhttps://api.icodeeasy.cc, a root URL without /v1
ANTHROPIC_MODELglm-5.3, the model for the current session
ANTHROPIC_DEFAULT_HAIKU_MODELglm-5.3, mapping for the Haiku alias
ANTHROPIC_DEFAULT_SONNET_MODELglm-5.3, mapping for the Sonnet alias
ANTHROPIC_DEFAULT_OPUS_MODELglm-5.3, mapping for the Opus alias
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1, disables nonessential traffic

The three default model variables keep Claude Code’s Haiku, Sonnet, and Opus aliases pointed at GLM-5.3. They do not turn GLM into a Claude model. The older ANTHROPIC_SMALL_FAST_MODEL variable is omitted from the recommended template; use the three default model variables above.

Linux / MacOS

Paste this configuration into the terminal where you will run Claude Code. Replace the placeholder with your service Key. These values initially apply to the current terminal session:

export ANTHROPIC_AUTH_TOKEN="your I Code Easy API Key"
export ANTHROPIC_BASE_URL="https://api.icodeeasy.cc"
export ANTHROPIC_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_SONNET_MODEL="glm-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="glm-5.3"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"

To persist the settings, add the same export lines to your shell’s startup file: ~/.zshrc for zsh or ~/.bashrc for bash. Run only the line that matches your shell:

source ~/.zshrc
source ~/.bashrc

You can also open a new terminal. An existing Claude Code process will not pick up changed environment variables; exit it and launch it again from the configured terminal.

Windows

To configure only the current PowerShell session, run:

$env:ANTHROPIC_AUTH_TOKEN = "your I Code Easy API Key"
$env:ANTHROPIC_BASE_URL = "https://api.icodeeasy.cc"
$env:ANTHROPIC_MODEL = "glm-5.3"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "glm-5.3"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "glm-5.3"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "glm-5.3"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"

For persistence at user level, run this code in the same window after setting the variables above. It saves those seven values to your user environment:

$names = @(
  "ANTHROPIC_AUTH_TOKEN",
  "ANTHROPIC_BASE_URL",
  "ANTHROPIC_MODEL",
  "ANTHROPIC_DEFAULT_HAIKU_MODEL",
  "ANTHROPIC_DEFAULT_SONNET_MODEL",
  "ANTHROPIC_DEFAULT_OPUS_MODEL",
  "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"
)
foreach ($name in $names) {
  $value = [Environment]::GetEnvironmentVariable($name, "Process")
  [Environment]::SetEnvironmentVariable($name, $value, "User")
}

User environment values are read by processes launched later. Open a new PowerShell window after saving. If you use VS Code or another integrated terminal, restart its host application too, then launch Claude Code.

Verify locally, then send a real request

First confirm the client is installed. This command prints its version without making a model request:

claude --version

Check whether the Key exists using a boolean result; do not print the Key itself:

macOS / Linux:

test -n "$ANTHROPIC_AUTH_TOKEN" && echo true || echo false

PowerShell:

[bool]$env:ANTHROPIC_AUTH_TOKEN

Run claude from the configured terminal, then enter /status in the client to inspect the model and connection settings. The status screen is a configuration clue. Seeing Claude Code, Haiku, Sonnet, or Opus in the interface alone does not prove that a Claude model handled a request.

Next, send a short prompt yourself in Claude Code, such as “Reply only OK.” This makes a real request and is billed under current rules. Check request logs for success, the recorded model, and charges. Do not rely on the model’s self-identification in its reply.

Common errors and troubleshooting

SymptomFirst checks
401 / authentication failedUse your service Key without extra spaces; check whether it was rotated and whether the URL and Key belong to the same service. Do not share the Key for inspection.
403 / access deniedCheck account status, endpoint selection, and current model access. Send support the error text and time, without the Key.
429 / request limitedRead the full error and dashboard status; reduce concurrency and retry later. A 429 does not always mean insufficient balance.
Claude names still appearCheck ANTHROPIC_MODEL and all three default variables. Client names, model aliases, and the request model are distinct; cross-check request logs.
Settings do not applyExit the old client and launch from a new terminal. Check startup files, user environment, and client settings for conflicting values; ensure you edited the shell you actually use.
Timeout / network errorCheck your local proxy and connection. Try the JP/SG URLs below, then see connection troubleshooting.

If the main domain is slow, replace only ANTHROPIC_BASE_URL; keep other variables unchanged. The backup URLs also omit /v1:

https://jp.icodeeasy.cc
https://sg.icodeeasy.cc

Restart Claude Code after switching, then repeat verification. For troubleshooting, share the error code, time, and redacted logs, never the raw Key.

When switching models or terminals

If you previously configured Claude or Kimi, check existing model settings in this terminal before applying these values. Do not mix values from separate guides. To switch back, restore the URL, Key, and model variables according to that model’s guide.

A system terminal, an IDE terminal, and a running client can inherit different environments. Configure and verify in the same terminal you use to launch Claude Code.