Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Setup guide - Documented by DeepSeek

Use DeepSeek in Claude Code

DeepSeek publishes a Claude Code integration guide that points Claude Code at DeepSeek's Anthropic-compatible endpoint (https://api.deepseek.com/anthropic) through environment variables. The default model is deepseek-flash, which serves DeepSeek-V4.1-Flash-1017 (1M context, 384K max output).

Last verified 5 steps4 official sources

Steps

  1. Step 1.

    Install Claude Code (Node.js 18+ required; Windows users also need Git for Windows).

    Terminal
    npm install -g @anthropic-ai/claude-code
  2. Step 2.

    Check that the install worked.

    Terminal
    claude --version
  3. Step 3.

    Get an API key from https://platform.deepseek.com/api_keys, then set the environment variables (Linux / Mac).

    Terminal
    export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
    export ANTHROPIC_AUTH_TOKEN=<your DeepSeek API Key>
    export ANTHROPIC_MODEL=deepseek-flash[1m]
    export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-flash[1m]
    export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-flash[1m]
    export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-flash
    export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-flash
    export CLAUDE_CODE_EFFORT_LEVEL=max
    export CLAUDE_CODE_AUTO_COMPACT_WINDOW=786432
  4. Step 4.

    Windows (PowerShell) equivalent.

    Terminal
    $env:ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
    $env:ANTHROPIC_AUTH_TOKEN="<your DeepSeek API Key>"
    $env:ANTHROPIC_MODEL="deepseek-flash[1m]"
    $env:ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-flash[1m]"
    $env:ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-flash[1m]"
    $env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-flash"
    $env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-flash"
    $env:CLAUDE_CODE_EFFORT_LEVEL="max"
    $env:CLAUDE_CODE_AUTO_COMPACT_WINDOW="786432"
  5. Step 5.

    Go to your project directory and start Claude Code.

    Terminal
    cd /path/to/my-project
    claude

Caveats

  • DeepSeek's guide sets every Claude Code tier to deepseek-flash. deepseek-v4-pro (DeepSeek-V4-Pro-0813) is the other current model id DeepSeek lists for the Anthropic format; using it as ANTHROPIC_MODEL is our combination, not a snippet from the guide. It costs more and does not support vision.
  • DeepSeek maps Claude model names it receives: names starting with claude-opus go to deepseek-v4-pro, and claude-haiku / claude-sonnet names go to deepseek-flash. Other unsupported names that do not start with claude return a 400 error.
  • On the Anthropic endpoint, DeepSeek ignores cache_control, top_k, mcp_servers and container. It does not support document or mcp_tool_use content blocks. thinking is supported but budget_tokens is ignored.
  • The legacy ids deepseek-v4-flash and deepseek-v4-flash-vision-exp still work but are now served by DeepSeek-V4.1-Flash-1017. deepseek-chat and deepseek-reasoner were scheduled for discontinuation on 2026-07-24.

FAQ

How do I use DeepSeek in Claude Code?

DeepSeek publishes a Claude Code integration guide that points Claude Code at DeepSeek's Anthropic-compatible endpoint (https://api.deepseek.com/anthropic) through environment variables. The default model is deepseek-flash, which serves DeepSeek-V4.1-Flash-1017 (1M context, 384K max output).

Which DeepSeek model ids work in Claude Code?

The official docs read for this guide list deepseek-flash and deepseek-v4-pro. Requests go to https://api.deepseek.com/anthropic.

Is this an official DeepSeek and Claude Code setup?

DeepSeek documents this setup in its own docs. It was last checked against 4 official pages on October 17, 2026.

Sources

Last verified against 4 official pages.

Newsletter

New models, set up the day they ship

One email per week. New model releases, the coding tools that support them and how to wire them up.