Compare · Explainer · Last verified 2026-10-30

DeepSeek web search in Claude Code and Codex: what it costs and how to turn it on

Short answer

If you run Claude Code or Codex on the DeepSeek API, their web searches go through DeepSeek’s own Search API. Those searches are free until 16:00 UTC on October 31, 2026 (midnight Beijing time, November 1). After that each successful search costs $0.75 per 1,000, on top of the model tokens Claude Code spends summarizing results. Same DeepSeek API key, no extra setup in Claude Code; Codex needs deepseek-v4-pro and one config change. Checked against DeepSeek’s docs on 2026-10-30.

Key facts

Free period ends00:00 Beijing time, Nov 1, 2026 (16:00 UTC Oct 31; 12:00 noon US Eastern Oct 31)
Price after that$0.75 per 1,000 successful searches (Fetch is also $0.75 per 1,000). Empty results, failures and timeouts are not billed.
Extra cost in Claude CodeModel tokens for the extra calls that summarize search results, at the normal model price
KeyYour normal DeepSeek API key; no separate search key
Rate limitsSearch 100 requests/s, Fetch 25 requests/s, per account; Fetch also has an unpublished per-domain limit; 429 when exceeded
Claude CodeWeb Search supported natively through https://api.deepseek.com/anthropic
CodexBuilt-in web search only with deepseek-v4-pro; off by default in DeepSeek’s setup script

Claude Code setup

DeepSeek’s Claude Code guide points Claude Code at its Anthropic-compatible endpoint with environment variables. These are the Linux and macOS lines from that guide; once they are set, Web Search needs no further configuration.

ShellClaude Code on DeepSeek (from DeepSeek’s docs)
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
cd /path/to/my-project
claude

DeepSeek also maps Claude model names: anything starting with claude-opus goes to deepseek-v4-pro (billed at the V4 Pro price), and claude-sonnet or claude-haiku names go to deepseek-flash. Watch for that if a tool hard-codes an Opus model name.

Codex setup

DeepSeek’s Codex guide offers a setup script that configures deepseek-flash or deepseek-v4-pro and writes web_search = "disabled". To get web search, switch to V4 Pro and turn it on in ~/.codex/config.toml, then restart Codex:

TOML~/.codex/config.toml (web search on)
model = "deepseek-v4-pro"
web_search = "live"

DeepSeek runs those searches on its servers and bills them at Search API prices.

Calling the Search API directly

The same searches are available as a standalone endpoint for your own agents. It takes a query of 1 to 128 characters and returns 1 to 50 results. We have no paid key, so we only confirmed that it requires one:

ShellKeyless check (run 2026-10-30)
curl -s https://api.deepseek.com/v1/tools/search \
  -H "Content-Type: application/json" \
  -d '{"query":"DeepSeek V4 release","count":3}'
# HTTP 401
# {"error":{"message":"Authentication Fails (missing key) ...","type":"authentication_error", ...}}

Full field list, result format and data terms are on our DeepSeek Search & Fetch page.

What a month of searching costs

At $0.75 per 1,000, an agent that makes 200 successful searches a day (about 6,000 a month) would pay about $4.50 a month for the searches. This is our arithmetic on DeepSeek’s list price, not a measured bill, and it leaves out the model tokens for summarizing results, which depend on your model and how much each search returns. [example calculation]

Before the free period ends

  • Check your DeepSeek balance: searches are paid from your topped-up or granted balance, and DeepSeek says to top up after a 402.
  • Heavy researcher? Compare with free or keyless options such as Keenable search or Parallel’s keyless MCP.
  • Regulated data? DeepSeek’s terms are governed by PRC law and its privacy policy says data is processed in China, with no residency option for Search.

FAQ

Does Claude Code web search work with the DeepSeek API?

Yes. DeepSeek says its Anthropic-compatible API natively supports Claude Code’s Web Search tool. When the model decides a question needs the web, the search runs through DeepSeek’s own Search API on the server; you do not add a separate search key.

How much does DeepSeek web search cost in Claude Code or Codex?

These server-side searches are free until 00:00 Beijing time on November 1, 2026 (16:00 UTC on October 31). After that they are billed at Search API prices: $0.75 per 1,000 successful searches. Claude Code also makes extra model calls to summarize what it found, and those tokens are billed at the normal model price.

Do I need a separate DeepSeek Search API key?

No. DeepSeek’s docs use the same DeepSeek API key (Authorization: Bearer) for Search, Fetch and the model APIs. Calling the Search endpoint without a key returns HTTP 401, which we confirmed on 2026-10-30.

Why doesn’t web search work in Codex with DeepSeek?

DeepSeek says Codex’s built-in web search only works with deepseek-v4-pro, and its setup script writes web_search = "disabled". Switch the model to deepseek-v4-pro and set web_search = "live" in ~/.codex/config.toml, then restart Codex.

What are the DeepSeek Search API rate limits?

100 requests per second for Search and 25 for Fetch, per account across all keys, separate from model concurrency limits. Fetch also has a per-domain limit whose number is not published. Over-limit requests get HTTP 429. Our October 17 check showed 5 and 5, so DeepSeek has raised them since.

Methodology

Every fact on this page comes from DeepSeek’s documentation, checked on 2026-10-30, plus one keyless request we ran ourselves. We made no paid requests and did not run Claude Code or Codex against DeepSeek. Items marked in amber are our own calculations. AgentAPIList has no affiliate or sponsor relationship with DeepSeek. See our methodology.

Sources (checked 2026-10-30)

Related