Skip to main content
Claude models are available again from October 18, 2026. Switch the model IDs as shown in Use Claude models, and keep in mind:
  • Claude Code’s WebSearch tool relies on Anthropic’s server-side search, which isn’t available.
  • Each response is capped at 32,768 output tokens.

Install Claude Code

Install it globally with npm (Node.js required):

Configure LaoZhang API

1

Edit settings.json

Open or create ~/.claude/settings.json and add:
  • For ANTHROPIC_AUTH_TOKEN, create a key in Tokens in the Claude Code group with the Usage-first billing mode. If you already use a default-group key here, create a new Claude Code-group key or edit the existing one and change its group.
  • Use the bare host for ANTHROPIC_BASE_URL, without /v1; Claude Code adds /v1/messages itself.
  • The three ANTHROPIC_DEFAULT_*_MODEL entries make background tasks and subagents use glm-5.2 too. Otherwise they request default models LaoZhang API doesn’t offer.
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS turns off experimental request fields that some routes reject with a 400; see Fix Claude Code 400 ValidationException.
If the file already exists, merge these keys into its env block without removing anything else. The file holds your full key, so keep it out of repositories and screenshots.
2

Clear conflicting variables

Values in the env block of settings.json override variables with the same name in your shell, so most setups need no cleanup. Two cases still send requests somewhere other than LaoZhang API:
  • CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, or CLAUDE_CODE_USE_FOUNDRY is set in your shell or shell profile. Claude Code uses cloud provider credentials first, so unset them and remove them from your profile.
  • The project’s .claude/settings.json or .claude/settings.local.json sets its own ANTHROPIC_BASE_URL or ANTHROPIC_AUTH_TOKEN. Project settings take precedence over user settings, so remove those keys or set them to your LaoZhang API values.
3

Send a test request

If it prints connected, the setup works. Run claude in a project directory to start an interactive session.

Choose a model

To use DeepSeek, set the four model variables to:
ANTHROPIC_DEFAULT_HAIKU_MODEL handles lightweight background work, so a cheaper model fits there. Prices are in the model catalog. At startup, Claude Code may warn "glm-5.2" isn't described by this version's model catalog. It doesn’t recognize non-Claude model IDs, including DeepSeek, and assumes a 200K context window; everything else works normally.

Use Claude models

Set the four model variables to Claude models and cap the output at 32,000 tokens:
  • Always set ANTHROPIC_DEFAULT_HAIKU_MODEL. Without it, Claude Code runs background tasks on its default claude-haiku-4-5-20251001, which LaoZhang API doesn’t offer, and those requests fail with a 503.
  • Claude models on LaoZhang API return at most 32,768 output tokens per response, so keep CLAUDE_CODE_MAX_OUTPUT_TOKENS at or below that.
  • Other Claude model IDs and prices are in the Anthropic section of the catalog. For other differences from Anthropic’s API, see Claude model limits.

FAQ

I get a 503 “no available channels”

Check these in order:
  • Token group: use the Claude Code group with the Usage-first or Usage-based billing mode. Current group default … means a default token; DeepSeek, GLM, and Kimi need a Claude Code token over the Claude protocol.
  • Model IDs: all four model variables must use IDs from the table above. That group serves only Claude-protocol models, so a GPT or Gemini ID returns Current group claude_code ….
  • Haiku variable: if ANTHROPIC_DEFAULT_HAIKU_MODEL is missing, Claude Code requests Haiku 4.5, which isn’t offered, and gets the same error.
For other models, check the model catalog and announcements.

I get a 401

Make sure ANTHROPIC_AUTH_TOKEN is your full LaoZhang API key and isn’t overridden by the same keys in the project’s .claude/settings.json or .claude/settings.local.json. See Invalid API key or 404.

One task used a lot of tokens. Is that normal?

Yes. Each step sends the conversation history, file contents, and tool definitions, so a task can use hundreds of thousands of tokens. Give the token a quota and check each request’s usage in call logs.