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 custom model endpoints. Triggers on phrases like "change claude model", "switch claude to deepseek", "configure claude code model", "claude用别的模型".

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "claude-code-model" with this command: npx skills add moonbird0423/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):

  1. Environment variables (highest priority)
  2. ~/.claude/config.json
  3. ~/.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", "<api_key>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "<base_url>", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_MODEL", "<model>", "User")

Clear conflicting variables:

[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "", "User")

Step 2: Update config.json

Edit ~/.claude/config.json:

{
  "env": {
    "ANTHROPIC_API_KEY": "<api_key>",
    "ANTHROPIC_BASE_URL": "<base_url>",
    "ANTHROPIC_MODEL": "<model>"
  }
}

Step 3: Update settings.json

Edit ~/.claude/settings.json, add/update:

{
  "model": "<model>",
  "env": {
    "ANTHROPIC_BASE_URL": "<base_url>",
    "ANTHROPIC_API_KEY": "<api_key>"
  }
}

Step 4: Verify

Test the configuration:

claude --print "hi, what model are you?"

Common Issues

  • Auth conflict: Both ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY set → Clear ANTHROPIC_AUTH_TOKEN
  • Old model still shows: Check config.json for stale ANTHROPIC_MODEL value
  • Changes not生效: New terminal window required for env var changes

Popular Provider Examples

Providerbase_urlModels
DeepSeekhttps://api.deepseek.com/anthropicdeepseek-v4-flash, deepseek-v4-pro
GLM (阿里云)https://coding.dashscope.aliyuncs.com/apps/anthropicglm-5
QwenSame as GLMqwen-*

Script

Use the bundled script for automated configuration:

python scripts/configure_model.py --base-url <url> --model <name> --api-key <key>

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Spicy Ai Video

Turn a 60-second talking head clip into 1080p high-energy edited videos just by typing what you need. Whether it's turning bland footage into visually intens...

Registry SourceRecently Updated
Coding

Video Maker Fast

Get polished MP4 videos ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim...

Registry SourceRecently Updated
Coding

Generation Generator

generate text prompts or clips into AI generated videos with this skill. Works with MP4, MOV, PNG, JPG files up to 500MB. marketers, content creators, social...

Registry SourceRecently Updated
Coding

Editor On Android

Get edited MP4 clips ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim th...

Registry SourceRecently Updated