claude-code-model
/install claude-code-model
Claude Code Model Configuration
Switch Claude Code to use custom model providers (DeepSeek, GLM, Qwen, OpenAI-compatible endpoints).
Configuration Locations
Claude Code reads config from multiple sources (in priority order):
- Environment variables (highest priority)
~/.claude/config.json~/.claude/settings.json
Required Parameters
User must provide:
- base_url: API endpoint (e.g.,
https://api.deepseek.com/anthropic) - model: Model name (e.g.,
deepseek-v4-flash,glm-5) - api_key: API key
Workflow
Step 1: Update Environment Variables
Set user-level environment variables (persist across restarts):
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "\x3Capi_key>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "\x3Cbase_url>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "\x3Cmodel>", "User")
Clear conflicting variables:
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "", "User")
Step 2: Update config.json
Edit ~/.claude/config.json:
{
"env": {
"ANTHROPIC_API_KEY": "\x3Capi_key>",
"ANTHROPIC_BASE_URL": "\x3Cbase_url>",
"ANTHROPIC_MODEL": "\x3Cmodel>"
}
}
Step 3: Update settings.json
Edit ~/.claude/settings.json, add/update:
{
"model": "\x3Cmodel>",
"env": {
"ANTHROPIC_BASE_URL": "\x3Cbase_url>",
"ANTHROPIC_API_KEY": "\x3Capi_key>"
}
}
Step 4: Verify
Test the configuration:
claude --print "hi, what model are you?"
Common Issues
- Auth conflict: Both
ANTHROPIC_AUTH_TOKENandANTHROPIC_API_KEYset → ClearANTHROPIC_AUTH_TOKEN - Old model still shows: Check
config.jsonfor staleANTHROPIC_MODELvalue - Changes not生效: New terminal window required for env var changes
Popular Provider Examples
| Provider | base_url | Models |
|---|---|---|
| DeepSeek | https://api.deepseek.com/anthropic |
deepseek-v4-flash, deepseek-v4-pro |
| GLM (阿里云) | https://coding.dashscope.aliyuncs.com/apps/anthropic |
glm-5 |
| Qwen | Same as GLM | qwen-* |
Script
Use the bundled script for automated configuration:
python scripts/configure_model.py --base-url \x3Curl> --model \x3Cname> --api-key \x3Ckey>
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-code-model - After installation, invoke the skill by name or use
/claude-code-model - Provide required inputs per the skill's parameter spec and get structured output
What is claude-code-model?
Configure Claude Code to use custom models (DeepSeek, GLM, Qwen, etc.). Use when user wants to change Claude Code's model, switch API provider, or set up cus... It is an AI Agent Skill for Claude Code / OpenClaw, with 58 downloads so far.
How do I install claude-code-model?
Run "/install claude-code-model" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is claude-code-model free?
Yes, claude-code-model is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does claude-code-model support?
claude-code-model is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created claude-code-model?
It is built and maintained by MoonBird0423 (@moonbird0423); the current version is v1.0.0.