Use Zhipu AI in Claude Code

Prices and modelsEndpoint verified 2026-11-09

Generate a Claude Code config from the Anthropic-compatible endpoint in Zhipu AI's docs. The API key in the config is a placeholder; replace it with a key you create at Zhipu AI.

Endpoints

  • Pay as you gohttps://open.bigmodel.cn/api/anthropicGLM Coding Plan and pay-as-you-go share this endpoint; the key type decides which quota is used, and key types are not interchangeable.Docs · verified 2026-11-09

Generate the config

Pick from the 5 models this provider sells, or type another model name.

Save to ~/.claude/settings.json; merge it in if the file already exists
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_API_KEY": "",
    "ANTHROPIC_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "glm-5.3[1m]",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash[1m]"
  }
}

Models and prices

ModelInputOutputRatio
GLM-5.3-FlashXglm-5.3-flashx$0.30$1.051.00×
GLM-5.3-Flashglm-5.3-flash$0.12$0.421.00×
GLM-5.3glm-5.3$1.20$4.201.00×
GLM-5.2glm-5.2$1.20$4.201.00×
GLM-5.1glm-5.1$0.899$3.601.00×
$ per 1M tokens. Each model uses the provider's cheapest group; the ratio uses the output price

How to check it works

Restart Claude Code and send a message. If it replies and the request shows up in Zhipu AI's console, it is using this endpoint.

FAQ

settings.json or environment variables?

settings.json applies every time Claude Code starts, for long-term use; the environment variables apply to the current terminal only, for a quick try.

How do I switch back to Anthropic?

Remove these variables from settings.json (or close the terminal where you set them), then restart Claude Code.

Does my key pass through this site?

No. The page only generates config text and never asks for your key; the key only goes into the config file or terminal on your own machine.

Claude Code configs for other providers