Using the DeepSeek API in Claude Code: Web Search and Model Mapping

Published 2026-05-22 01:00 426 words 3 min read ... Page views

The DeepSeek API natively supports the web search functionality in Claude Code, as well as model name mapping, which can be integrated in the developer mode of the Claude Desktop APP.
Listen to this article
0:00 / --:--

I previously configured the MiMo API, and this time I’d like to document how to use the DeepSeek API in Claude Code. In addition to basic dialogue capabilities, DeepSeek also supports web search and model name mapping, which is quite useful.


Web Search Functionality

The DeepSeek API natively supports the web search functionality within Claude Code. When using Claude Code, if the model determines that your question can only be answered through a search, it will automatically invoke the web search tool and perform the search using the DeepSeek API.

It’s important to note that calling the web search will generate additional large-model API requests (to summarize the search results), which will result in extra token costs.


Model Mapping

When using Claude Code or the Claude Desktop APP, DeepSeek will map the provided model names as follows:

Provided Model NameActual Mapping
Models starting with claude-opusdeepseek-v4-pro
Models starting with claude-haiku or claude-sonnetdeepseek-v4-flash

This means that in the developer mode of the new Claude Desktop APP, you can simply change the base_url and api_key to integrate with the DeepSeek models, without having to worry about model name restrictions.

<div align="center">
  <img src="/blog/deepseek-claude-code/model-mapping.jpg" alt="Claude Code Model Mapping Illustration" width="700" />
</div>

Configuration Method

Go to the DeepSeek official website to obtain your API Key.

For Linux / Mac:

export ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic
export ANTHROPIC_AUTH_TOKEN=Your DeepSeek_API_Key
export ANTHROPIC_MODEL=deepseek-v4-pro
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-pro
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_EFFORT_LEVEL=max
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash

For Windows (PowerShell):

$env:ANTHROPIC_BASE_URL = "https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "Your DeepSeek_API_Key"
$env:ANTHROPIC_MODEL = "deepseek-v4-pro"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = "deepseek-v4-pro"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "deepseek-v4-pro"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "deepseek-v4-flash"
$env:CLAUDE_CODE_EFFORT_LEVEL = "max"
$env:CLAUDE_CODE_SUBAGENT_MODEL = "deepseek-v4-flash"

After setting these environment variables, run claude in your project directory.


Differences from MiMo

Comparison ItemDeepSeekMiMo
Web SearchSupportedNot supported
Model MappingAutomatic mapping of model namesUse of model IDs directly
PricingPay-per-usePay-per-use + Token plan

If you need search functionality, DeepSeek is a better choice. If you’re just writing code, MiMo’s 1M context size might be more suitable.


Summary

Configuring the DeepSeek API in Claude Code is very simple, just like configuring other third-party APIs. The additional benefits include support for web search and model name mapping, which saves you some hassle. If you need to use multiple APIs, you can switch configurations for different use cases without having to uninstall and reinstall anything.

... Page views
© 2026 violet @qiyuan