Gangmax Blog

Claude Code With 3rd Party Models

From here.

First, make sure you have “node.js“ and “git“ installed.

Install Claude Code

1
npm install -g @anthropic-ai/claude-code

Get the API key

In my case, I use “DeepSeek“. You can use other LLM model providers(such as “kimi“) as well.

Setup Claude Code to use the API key

Update the “~/.claude/settings.json” file with the following content:

~/.claude/settings.json
1
2
3
4
5
6
7
8
9
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.deepseek.com/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR API KEY",
"ANTHROPIC_MODEL": "deepseek-chat",
"ANTHROPIC_SMALL_FAST_MODEL": "deepseek-chat",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
}
}

Open terminal, create a directory, get into it, and type “claude” to open the cli tool. If everything works, you should be able to play.

Comments