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

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.

Cost-control checklist for DeepSeek Claude Code Web Search
RiskWhat causes itSafer response
Too many search callsBroad prompts like 'research everything about X'Ask for one vendor doc, release note, or version check at a time
Unexpected Pro spendMain route handles every summarization turnKeep subagents on Flash and reserve Pro for the main thread
Stale adviceSearch is disabled for time-sensitive topicsAllow search for versions, outages, and current documentation

Sources checked

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

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.