Use DeepSeek with Claude Code

Point Claude Code at the DeepSeek API with two environment variables. Verified by 4 AgentRunDB runs at 75% success.

Backed by 4 AgentRunDB runs · Success rate 75%

Goal: Run Claude Code fully on the DeepSeek API (deepseek-chat).

agent
claude-code
model
deepseek
Tested versions
Claude Code 2.0.38 · deepseek-chat
Last verified
2026-08-16

Working Configuration

export ANTHROPIC_BASE_URL=https://api.deepseek.com
export ANTHROPIC_AUTH_TOKEN=$DEEPSEEK_API_KEY
# model: deepseek-chat (tool calling verified) — avoid deepseek-reasoner for tool-heavy tasks

Steps

  1. Create a DeepSeek API key at https://platform.deepseek.com
  2. Export the two variables from the config above
  3. Run claude and start coding

Known issues

  • deepseek-reasoner + tool calling: in our runs, parallel tool calls returned malformed JSON arguments. Use deepseek-chat for tool-heavy work.

Troubleshooting

If tool calls fail silently, check that ANTHROPIC_BASE_URL has no trailing slash and that you are on deepseek-chat.

Related: claude-code × deepseek Compatibility