Claude Code with GLM-5.3: The Setup That Works Running GLM-5.3 through Z.ai on Claude Code 2.1.266 requires setting CLAUDE_CODE_DISABLE_ARTIFACT=1, because Z.ai rejected Claude Code's built-in Artifact tool definition with a `400 [1210] Invalid API parameter` error, according to a setup guide tested on September 9, 2026. The guide also instructs users to register glm-5.3 and glm-5.3-flash in ~/.claude/settings.json via modelPicker options with behavesAs mappings to claude-opus-4-7 and claude-sonnet-4-6 to clear the unknown-model catalog warning, and to set CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000 for the models' 1M-token context window. The author notes that changing the effort level was not the fix and that interactive mode must be tested separately because `claude-zai -p` succeeded while interactive mode failed. ← Writing https://nibzard.com/log Claude Code with GLM-5.3: The Setup That Works Run GLM-5.3 through Z.ai on Claude Code 2.1.266. Fix the 400 error, model warning, and context window. Share and tools My Z.ai setup broke with the latest CC update. Claude Code warned about an unknown model, then returned 400 1210 Invalid API parameter . The warning and the failure had separate fixes. Z.ai was rejecting Claude Code’s built-in Artifact tool definition. Removing that tool made the same request succeed. Changing the effort level was not the fix, though I spent a while convinced it was. Tested on September 9, 2026 with Claude Code 2.1.266 and GLM-5.3. This is what worked on that version. Gateways change, so re-check if you are reading this later. This follows my multiple-provider setup https://nibzard.com/claude-dual-provider : one Claude install, shared settings, and a claude-zai wrapper that selects the provider. 1-update-claude-code 1. Update Claude Code Use your existing installation: claude update claude --version 2-configure-the-zai-wrapper 2. Configure the Z.ai wrapper Keep the API key in your existing secret store. This example uses pass https://www.passwordstore.org/?utm source=nibzard.com : pass insert api/zhipu mkdir -p ~/bin Save this as ~/bin/claude-zai . If you already have a wrapper, update it and keep your existing credential lookup. bash /usr/bin/env bash set -euo pipefail ZAI TOKEN="$ pass show "${CLAUDE ZAI PASS ENTRY:-api/zhipu}" " ZAI TOKEN="${ZAI TOKEN%%$'\n' }" : "${ZAI TOKEN:?Z.ai API key is empty}" unset ANTHROPIC API KEY ANTHROPIC MODEL CLAUDE CONFIG DIR export ANTHROPIC AUTH TOKEN="$ZAI TOKEN" export ANTHROPIC BASE URL="https://api.z.ai/api/anthropic" export ANTHROPIC DEFAULT OPUS MODEL="glm-5.3" export ANTHROPIC DEFAULT SONNET MODEL="glm-5.3-flash" export ANTHROPIC DEFAULT HAIKU MODEL="glm-5.3-flash" export API TIMEOUT MS="3000000" Work around the Artifact tool schema rejected by Z.ai on 2.1.266. export CLAUDE CODE DISABLE ARTIFACT=1 Use the models' 1M-token context window. export CLAUDE CODE MAX CONTEXT TOKENS=1000000 exec claude "$@" Make it executable and ensure ~/bin is on your shell’s PATH : chmod +x ~/bin/claude-zai command -v claude-zai Keep these exports inside the wrapper. Putting the gateway URL and token in global Claude settings routes your normal Claude sessions through Z.ai too. CLAUDE CODE DISABLE ARTIFACT=1 disables Claude’s Artifact tool for this entry point. File editing and shell tools still work. The context setting follows Z.ai’s 1M configuration https://docs.z.ai/devpack/tool/claude?utm source=nibzard.com . 3-register-the-models 3. Register the models Merge this into ~/.claude/settings.json . Preserve your existing settings and any other modelPicker.options entries. { "modelPicker": { "options": { "model": "glm-5.3", "label": "GLM-5.3", "behavesAs": "claude-opus-4-7" }, { "model": "glm-5.3-flash", "label": "GLM-5.3 Flash", "behavesAs": "claude-sonnet-4-6" } } } behavesAs tells Claude Code which known model’s client-side handling to use. Requests still go to GLM. These entries remove the catalog warning. They do not fix the Artifact error; that fix is the env var from step 2. I kept my saved xhigh setting. The gateway accepted it during testing. What GLM does with that number on its side, I do not know. 4-test-interactive-mode 4. Test interactive mode Exit existing sessions and start a new one: claude-zai --model opus Ask: Use Bash to run pwd once, then return the directory path. Do not change any files. You should see GLM-5.3 without the catalog warning, a successful tool call, and a final response without the 400 error. Approve the shell call if prompted. Do not skip this test. claude-zai -p succeeded while interactive mode failed, and interactive mode is what I actually use. The print test nearly convinced me everything worked. give-this-to-your-agent Give this to your agent Configure Claude Code using this article. Inspect and back up my existing settings and provider wrapper first. Reuse my credential store, merge the model entries, and keep Z.ai environment variables scoped to the wrapper. If files are symlinked, edit their source. Verify the installed version and run the interactive pwd test. Preserve my other settings and report what changed. Get more like this in your inbox. Unsubscribe anytime.