claude-code-model
by @moonbird0423
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...
clawhub install claude-code-modelπ About This Skill
name: claude-code-model description: 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 custom model endpoints. Triggers on phrases like "change claude model", "switch claude to deepseek", "configure claude code model", "claudeη¨ε«η樑ε".
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):
1. Environment variables (highest priority)
2. ~/.claude/config.json
3. ~/.claude/settings.json
Required Parameters
User must provide:
https://api.deepseek.com/anthropic)deepseek-v4-flash, glm-5)Workflow
Step 1: Update Environment Variables
Set user-level environment variables (persist across restarts):
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "", "User")
Clear conflicting variables:
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "", "User")
Step 2: Update config.json
Edit ~/.claude/config.json:
{
"env": {
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_BASE_URL": "",
"ANTHROPIC_MODEL": ""
}
}
Step 3: Update settings.json
Edit ~/.claude/settings.json, add/update:
{
"model": "",
"env": {
"ANTHROPIC_BASE_URL": "",
"ANTHROPIC_API_KEY": ""
}
}
Step 4: Verify
Test the configuration:
claude --print "hi, what model are you?"
Common Issues
ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY set β Clear ANTHROPIC_AUTH_TOKENconfig.json for stale ANTHROPIC_MODEL valuePopular 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 --model --api-key