DeepSeek Web Search Tool API: deepseek_web_search Setup, Pricing and Fixes
Set up deepseek_web_search and deepseek_read_url across DeepSeek's Messages, Responses, and Chat Completions APIs, compare per-request pricing, and fix 400 and gateway errors.
Summary
- Declare deepseek_web_search and deepseek_read_url on deepseek-flash across Messages, Responses.
- Toggle thinking (or reasoning effort) to switch between single-pass Web Search and multi-step Deep Thinking Search with open_page and find_in_page actions.
- Understand the $0.75 per 1,000 successful requests billing rule after the November 1, 2026 free tier cutoff, silent parameter overrides.
On November 13, 2026, DeepSeek rolled out its full application API suite in the official API changelog, exposing the server-side web search, URL reader, file input, and safety check pipelines that power the DeepSeek web and mobile apps. Instead of wiring up an external search API and running a local tool-calling loop, you can now pass deepseek_web_search and deepseek_read_url directly inside your tools array on the deepseek-flash model. DeepSeek's backend decides when to query the web, parses the pages, and returns a cited answer in a single request stream.
If you tried configuring this using older guides from August or October, you probably ran into silent failures where the model ignores your search tool, or HTTP 400 rejections when mixing tools. Below is the exact setup across all three supported protocols, how the thinking switch changes search behavior, how per-request billing stacks on top of token costs, and how to fix the errors that break multi-turn sessions.
On this page
How to Enable deepseek_web_search and deepseek_read_url Across All Three Endpoints
DeepSeek's Web Tools documentation defines deepseek_web_search and deepseek_read_url as server tools. When you declare them, your client code never executes a tool call. The model triggers the search or URL fetch internally on DeepSeek's infrastructure and streams the intermediate status blocks alongside the final response. If you only want the model to read links that a user pastes into the prompt without running open-ended web queries, declare deepseek_read_url by itself.
Right now, the server tools require the deepseek-flash model identifier. If your codebase still sends the legacy aliases deepseek-v4-flash or deepseek-v4-flash-vision-exp, the API accepts them and routes them to the same DeepSeek-V4.1-Flash-1017 instance (which we covered in our Oct 12–18, 2026 LLM API changes roundup), but I recommend pinning deepseek-flash explicitly.
1. Anthropic-Compatible Messages API (/anthropic/v1/messages)
When calling the Anthropic-compatible endpoint, each entry in the tools array requires both a type and a name key matching the tool identifier:
curl https://api.deepseek.com/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-flash",
"thinking": {"type": "enabled"},
"tools": [
{"type": "deepseek_web_search", "name": "deepseek_web_search"},
{"type": "deepseek_read_url", "name": "deepseek_read_url"}
],
"messages": [
{"role": "user", "content": "What changed in DeepSeek V4.1 Flash and the Nov 13 API update?"}
],
"stream": true
}'
2. OpenAI-Compatible Responses API (/responses)
On the /responses endpoint, you omit the name field inside tools and control deep reasoning through the reasoning object instead of thinking:
curl https://api.deepseek.com/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-flash",
"reasoning": {"effort": "high"},
"tools": [
{"type": "deepseek_web_search"},
{"type": "deepseek_read_url"}
],
"input": "What changed in DeepSeek V4.1 Flash and the Nov 13 API update?",
"stream": true
}'
3. OpenAI-Compatible Chat Completions API (/chat/completions)
The classic /chat/completions endpoint also supports server tools now. Like the Responses API, it only needs the type key inside each tool object, while using the top-level thinking parameter to toggle reasoning:
curl https://api.deepseek.com/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-d '{
"model": "deepseek-flash",
"thinking": {"type": "enabled"},
"tools": [
{"type": "deepseek_web_search"},
{"type": "deepseek_read_url"}
],
"messages": [
{"role": "user", "content": "What changed in DeepSeek V4.1 Flash and the Nov 13 API update?"}
],
"stream": true
}'
Alongside the web tools, the November 13 update introduced file input blocks for document parsing, a top-level title: true boolean that generates a conversation title at the end of the reply, and a safety_check object ({"level": "low"} or {"level": "high"}) for baseline input and output moderation.
Reading links with deepseek_read_url
The deepseek_read_url tool shipped on 2026-11-13 together with web search and file input. With the tool enabled, the model detects links in the user message, fetches the pages and answers with them in context, as the official changelog describes it. deepseek-flash supports it in the Messages, Responses and Chat Completions APIs. The only setting the changelog mentions is enabling the tool in tools. It gives no separate price for URL reading, so check the Models & Pricing page before you estimate costs.
The Read links section of the Web Tools guide covers the details: only the last user message is checked for URLs, and the model decides which of the first 10 distinct links to read. Its billing note says each page fetched successfully is billed, while links that cannot be fetched are not. Treat the exact per-fetch rate as unconfirmed until you have read it on the pricing page.
Standard Web Search vs. Deep Thinking Search
The thinking flag does more than turn on chain-of-thought tokens; it changes how the search engine operates under the hood. DeepSeek splits this into two distinct execution modes in the Deep Thinking Search guide:
| Feature | Standard Web Search | Deep Thinking Search |
|---|---|---|
| Messages API Config | "thinking": {"type": "disabled"} |
"thinking": {"type": "enabled"} |
| Responses API Config | "reasoning": {"effort": "none"} |
"reasoning": {"effort": "high"} |
| Chat Completions Config | Omit thinking or set "disabled" |
"thinking": {"type": "enabled"} |
| Search Depth | Single retrieval pass (can bundle multiple strings in input.queries) |
Multi-round iterative search interleaved with reasoning steps |
| Page Navigation | Reads returned search snippets to build cited answer | Executes open_page to read full pages and find_in_page to locate exact terms |
| Image Search | Single visual lookup when user prompt includes input_image |
Multi-step visual search, including cropping specific image regions |
When I test simple factual lookups, disabling thinking keeps latency down because the model issues one query batch and writes the response immediately. When I enable thinking, the model evaluates the first set of search snippets inside its reasoning trace, opens promising URLs with open_page, scans long documents with find_in_page, and runs follow-up searches if the first page lacked a version number or benchmark figure.
deepseek_web_search also handles visual search automatically. If you pass an image in the user message (such as an input_image block), the model can run reverse image searches. In Deep Thinking Search mode, it can even select and crop individual regions inside your uploaded image to search for multiple objects separately.
Pricing, Free Operations, and Rate Limits
DeepSeek now offers two ways to access its search index: the built-in server tools (deepseek_web_search and deepseek_read_url) and the standalone Search and Fetch HTTP endpoints (/search and /fetch) released on October 17, 2026. If you read early posts claiming that server-side search in Claude Code, Codex, or DeepSeek Harness is free, note that the promotional free window ended at 00:00 Beijing time on November 1, 2026. Every call is now billed.
According to the Models & Pricing page and the Search & Fetch billing guide, tool execution fees and model token fees are calculated separately and added together on your invoice:
| Billing Item | Off-Peak Rate (UTC) | Peak Rate (Mon–Fri 01:00–04:00 & 06:00–10:00 UTC) | Billing Rule & Limits |
|---|---|---|---|
Web Search (deepseek_web_search or Search API) |
$0.75 / 1,000 searches | $0.75 / 1,000 searches | Billed only on HTTP 200 with non-empty results. Standalone limit: 100 QPS per account. |
Web Fetch / Read URL (deepseek_read_url or Fetch API) |
$0.75 / 1,000 fetches | $0.75 / 1,000 fetches | Billed only on HTTP 200 returning Markdown text. Standalone limit: 25 QPS per account + per-domain cap. |
deepseek-flash Input (Cache Hit) |
$0.003 / 1M tokens | $0.006 / 1M tokens | 1M token context window; 2,500 concurrent requests limit. |
deepseek-flash Input (Cache Miss) |
$0.15 / 1M tokens | $0.30 / 1M tokens | Includes prompt text, uploaded file tokens, and injected search context. |
deepseek-flash Output Tokens |
$0.60 / 1M tokens | $1.20 / 1M tokens | 384K max output; includes both visible reply and thinking tokens. |
When estimating costs for an agent workflow, pay close attention to how DeepSeek counts individual search and fetch events during a single API turn:
- Multi-query splitting: If the model generates a single search tool call containing three query strings inside
input.queries, DeepSeek bills that as 3 searches, not 1. - Image region searches: Submitting an image triggers 1 search for the full image, plus 1 additional search for every cropped sub-region the model inspects during Deep Thinking Search.
- Unbilled navigation steps: Failed requests, timeouts, and searches returning zero results cost nothing. Inside Deep Thinking Search, running
find_in_pageis completely free, scrolling or paging through an open document is free, reopening a URL that was already fetched in the same turn is free, and callingopen_pageon a result whose full text was already bundled in the initial search payload is also free.
Pending Official Confirmation: Schema Gaps and the web_search vs. deepseek_web_search Trap
While testing the November 13 release against existing OpenAI-compatible SDKs, I found two areas where DeepSeek's documentation either conflicts across pages or leaves internal schemas undocumented.
1. web_search on deepseek-v4-pro vs. deepseek_web_search on deepseek-flash (Pending Official Confirmation)
If you check DeepSeek's older Responses API guide, it instructs developers to pass tools: [{"type": "web_search"}] and explicitly notes that web_search is supported on deepseek-v4-pro but silently ignored on deepseek-flash. Conversely, the November 13 Web Tools guide introduces deepseek_web_search, restricts it to deepseek-flash, and does not list deepseek-v4-pro support.
Right now, if you pass "type": "web_search" to deepseek-flash (which many third-party SDK wrappers still do by default), the API returns HTTP 200 without throwing an error, but the model never searches the web. Whether DeepSeek plans to deprecate the web_search identifier on deepseek-v4-pro or enable deepseek_web_search across the Pro tier has not been clarified in the changelog yet. Until the docs are unified, verify that any request targeting deepseek-flash uses the exact string deepseek_web_search.
2. Undocumented server_tool_calls Signatures and Silent Parameter Overrides
As documented in DeepSeek's Build a Chatbot guide, enabling deepseek_web_search, deepseek_read_url, or safety_check: {"level": "high"} causes the server to lock down sampling parameters. Any client values you send for temperature, top_p, top_k, frequency_penalty, presence_penalty, stop, seed, thinking.budget_tokens, preserve_thinking, or parallel_tool_calls are silently ignored rather than rejected. Only max_tokens (or max_output_tokens on /responses) stays active, and it caps each individual reasoning step rather than the total token count across the multi-step search loop.
In addition, when the assistant uses server tools, the response includes server_tool_calls blocks carrying a kind field and an encrypted signature token. DeepSeek has not published a formal JSON schema for verifying or inspecting this signature payload outside of passing the raw assistant message back on the next turn.
Troubleshooting Common deepseek_web_search Errors
When deepseek_web_search fails, it either throws a validation 400 at the edge or loses context mid-conversation. Here is how to fix each failure mode based on the Web Tools error reference and gateway trace logs.
tool_choice: deepseek_web_search cannot be forced (HTTP 400)
DeepSeek does not allow you to force a server tool call via tool_choice: {"type": "function", "name": "deepseek_web_search"} or tool_choice: {"type": "tool", "name": "deepseek_web_search"}. Remove tool_choice or set it to "auto". If you pass tool_choice: "required" on the Responses or Chat Completions endpoints, the server silently downgrades it to "auto", whereas tool_choice: "none" disables all tools for that turn.
tools: other tools cannot be used together with deepseek_web_search... (HTTP 400)
You cannot mix deepseek_web_search or deepseek_read_url with custom client-side function tools (or the legacy web_search type) in the same request. You also cannot declare deepseek_web_search twice in the same tools array (deepseek_web_search can only be declared once). If your agent needs both live web search and local database function calling, separate the web research step into its own deepseek-flash call before routing the output to your function-calling turn.
tools: allowed_domains is not supported by deepseek_web_search (HTTP 400)
Developers migrating payloads from Anthropic or OpenAI often include allowed_domains, blocked_domains, or user_location inside the tool definition. DeepSeek rejects all extra keys inside the tool object. Strip those fields from tools and append standard search operators—such as site:github.com or -site:example.com—directly into the user prompt or system instructions.
messages: the last assistant message used deepseek_web_search... and cannot be continued (HTTP 400)
If you use prefix continuation (setting prefix: true on the final assistant message in Chat Completions or Messages to resume a cut-off answer), the API will reject the request with HTTP 400 if that turn invoked a web tool. You must re-send the prompt as a new generation turn instead of continuing the partial assistant block. Similarly, if you pass safety_check: true instead of an object, you will hit safety_check: level must be low or high—always format it as {"level": "low"} or {"level": "high"}.
Gateways Stripping Server Tools or Dropping Multi-Turn Context
If you route requests through an API relay, LiteLLM, or New API, two silent bugs frequently occur. First, strict schema validators on older gateways strip any tool object that lacks "type": "function", causing deepseek-flash to answer from pre-cutoff memory without searching. If you run into schema rejections at the proxy layer, compare the response against our guide on fixing Claude Code API Error 400 messages and our walkthrough on LLM gateway tool blocks (CLAUDE_CODE_AUTO_MODE_SERVER=0). Bypass the proxy and hit https://api.deepseek.com directly to confirm whether the gateway is dropping the tools array.
Second, on follow-up questions in a multi-turn chat, the model may forget details from a URL it read in turn one. DeepSeek does not keep raw search snippets or open_page text in the conversation history across turns; only the assistant's written answer persists. However, for deepseek_read_url, the server can re-inject the fetched webpage on turn two—provided your client sends back the previous assistant message with its server_tool_calls array (kind and signature) untouched. If your chat frontend or API gateway strips unknown fields from historical assistant messages before sending turn two, the server loses the signature and cannot reconstruct the page content.
HTTP 200 Stream Truncation on Safety Blocks or Timeouts
Because search and content moderation run while the HTTP stream is already open, a safety block or upstream fetch timeout mid-generation cannot change the initial 200 OK HTTP status code. If your responses cut off mid-sentence without raising an SDK exception, inspect the final stream event: look for event: error on the Messages API, response.failed (or status: "failed") on the Responses API, or a trailing chunk containing an error object without a closing [DONE] marker on Chat Completions.