Updated 2026-06-10
DeepSeek Claude Code Web Search: official setup before you optimize prompts
DeepSeek's own Claude Code documentation now does two useful things on one page: it gives the exact Anthropic-compatible environment-variable setup, and it explicitly says the DeepSeek API natively supports the Web Search feature in Claude Code. That means the right starting point is no longer a community-only hack. The real job is to wire the official endpoint correctly, understand where search adds extra token spend, and verify that your main route still lands on DeepSeek V4 Pro while subagents stay on DeepSeek V4 Flash.
1. Start from the official Anthropic-compatible route
Claude Code should point at DeepSeek's Anthropic-compatible base URL, not the OpenAI-format endpoint. This is the vendor-documented path for Claude Code and the only route that the official guide explicitly supports.
DeepSeek's guide keeps the main coding model on `deepseek-v4-pro[1m]`, while routing subagents to `deepseek-v4-flash`. That split matters because Web Search often creates extra summarization and follow-up requests that are cheaper on Flash than on Pro.
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-..."
export ANTHROPIC_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"
export CLAUDE_CODE_EFFORT_LEVEL="max"Sources checked
- DeepSeek official Claude Code integration guide - Primary source for Claude Code environment variables and Web Search support wording.
2. What DeepSeek officially says about Web Search
DeepSeek's guide says the API natively supports the Web Search feature in Claude Code. The wording matters: the search tool is triggered by the model when it decides a question requires web retrieval, rather than by a separate DeepSeek-only CLI.
The same paragraph also explains the billing implication. When Web Search runs, DeepSeek generates additional model requests to summarize retrieved search content. So the total cost is not only the visible final answer; it includes the extra retrieval-summary turns behind the scenes.
That makes Web Search an official feature, but not a free one. Treat it as a deliberate capability for current facts, docs lookup, and release verification, not as the default for every coding prompt.
Sources checked
- DeepSeek official Claude Code integration guide - States that Web Search is natively supported and incurs additional LLM token costs.
3. When Web Search should actually be allowed
Use Web Search for time-sensitive questions: latest package versions, current release notes, price changes, live incidents, or third-party docs that are not already in your repository. Those are the cases where stale memory is a bigger risk than extra tokens.
Do not lean on Web Search for tasks that are already local and deterministic. Refactoring a repository, explaining your own code, or editing files from a checked-out project should stay local unless the model truly needs a missing external fact.
A practical team policy is to let search stay available, but ask developers to keep prompts narrow: name the package, repo, version, or vendor doc you want rather than asking for broad market summaries.
4. Cost control: separate endpoint costs from search-trigger costs
DeepSeek's pricing page keeps V4 Flash cheaper than V4 Pro across cache-hit input, cache-miss input, and output tokens. That is why the official Claude Code page keeps Flash as the subagent lane.
Web Search increases cost because the model has to inspect, condense, and reason over retrieved content. The cleanest control is not 'never use search'; it is to keep the expensive main route reserved for work that truly needs Pro and let repetitive background tasks stay on Flash.
If a team is spending too much, first audit which prompts are triggering search, then tighten prompt scope, reuse stable system instructions for cache hits, and move routine summarization toward Flash-first substeps.
| Risk | What causes it | Safer response |
|---|---|---|
| Too many search calls | Broad prompts like 'research everything about X' | Ask for one vendor doc, release note, or version check at a time |
| Unexpected Pro spend | Main route handles every summarization turn | Keep subagents on Flash and reserve Pro for the main thread |
| Stale advice | Search is disabled for time-sensitive topics | Allow search for versions, outages, and current documentation |
Sources checked
- DeepSeek models and pricing - Lists V4 Pro and V4 Flash token pricing and concurrency limits.
5. Verify the route before trusting the UI
The biggest operational mistake is trusting the client label instead of the provider-side route. If the model name is wrong or unsupported, you can think you are on Pro while DeepSeek actually serves Flash-family behavior.
DeepSeek's API quick-start still treats `deepseek-chat` and `deepseek-reasoner` as compatibility aliases scheduled for retirement on July 24, 2026. That means older configs are not a stable way to preserve quality or search behavior.
After a real Claude Code session, check usage or provider logs where possible. If you are teaching a team, pin exact model strings in internal templates and remove old alias names completely.
Sources checked
- DeepSeek official API quick-start - Lists exact current model names and the July 24, 2026 alias deprecation date.
6. Internal links for the next step
If you are still cleaning up old model IDs, go straight to `/guides/deepseek-chat-to-v4-migration`. That page is the cleaner migration playbook.
If your next question is model choice rather than search behavior, use `/guides/deepseek-v4-pro-vs-flash` to decide when Pro truly earns its extra cost.
If you are comparing endpoint families, read `/guides/deepseek-openai-vs-anthropic-api-routing` before mixing Claude Code, SDK code, and agent tooling in one setup.
FAQ
Does DeepSeek officially support Web Search in Claude Code?
Yes. DeepSeek's own Claude Code integration guide says the DeepSeek API natively supports the Web Search feature in Claude Code.
Does Web Search cost extra?
Yes in practice. DeepSeek says search creates additional LLM requests to summarize retrieved content, so you pay for those extra tokens too.
Which endpoint should Claude Code use?
Use `https://api.deepseek.com/anthropic`. That is the official Anthropic-compatible route documented by DeepSeek for Claude Code.
Should I keep `deepseek-chat` in old Claude Code configs?
No for new setups. The official quick-start marks `deepseek-chat` and `deepseek-reasoner` for deprecation on July 24, 2026.
Why does DeepSeek pin Pro for the main route and Flash for subagents?
Because it is a practical cost-quality split: keep stronger reasoning on the main path and push repetitive background work to the cheaper Flash lane.
DeepSeek Claude Code Web Search is no longer just a community trick. It is an officially documented DeepSeek capability, but it only pays off when the route is configured correctly, search is used for truly current facts, and teams verify that Pro and Flash are doing the jobs they were assigned.
Related model comparisons
Continue from this guide into structured DeepSeek-first comparison pages with model tables, routing advice, and pricing context.