· 6 min read
DeepSeek app API: web search, file input and safety checks
DeepSeek's app API adds built-in web search, URL reading, file input and safety checks to deepseek-flash. How each works, with limits and errors.

DeepSeek's app API release, published on 13 November 2026, gives developers the same built-in features the DeepSeek app uses: web search, URL reading, file input and a content safety check, all switched on with parameters on the existing chat endpoints. It works only with deepseek-flash, which currently points to DeepSeek-V4.1-Flash-1017. Alongside it, DeepSeek now sells Search, Fetch, OCR, speech-to-text and text-to-speech as standalone APIs.
This post covers what the release includes, how each built-in tool is called, how file input works, and the limits and errors you should plan for.
What is the DeepSeek app API?
Without built-in tools, a search-backed chatbot means running your own search provider, fetching pages, trimming them and stuffing the results into the prompt. The new release moves that loop to DeepSeek's side. You declare a tool in the request, and the server decides when to search, runs the calls, assembles the context and returns an answer with citations.
A server tool is a tool that the API provider executes itself, as opposed to a function tool, where the model asks your code to run something and you send the result back. Both built-in tools here are server tools.
The features are available on all three request formats DeepSeek supports:
| API format | Endpoint |
|---|---|
| Anthropic-style Messages | POST https://api.deepseek.com/anthropic/v1/messages |
| OpenAI-style Responses | POST https://api.deepseek.com/responses |
| OpenAI-style Chat Completions | POST https://api.deepseek.com/chat/completions |
The model behind them, deepseek-flash, has a 1M-token context window, up to 384K output tokens, image input, and both thinking and non-thinking modes. deepseek-v4-pro does not get the built-in features.
How do you turn on web search and URL reading?
There are two tools: deepseek_web_search and deepseek_read_url. You list them in the top-level tools array, and that declaration is the whole configuration. A Messages request looks like this:
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 the latest Node.js LTS?"}],
"stream": true
}'
In the Responses format the declaration is shorter: "tools": [{"type": "deepseek_web_search"}, {"type": "deepseek_read_url"}].
The thinking setting changes how search behaves:
- Thinking off, search declared: the model runs a normal web or image search when it needs one and answers with citations.
- Thinking on, search declared: the model runs a deep search. It searches, opens pages and looks inside them across several reasoning steps, up to roughly 20 tool calls, before it answers.
- Only
deepseek_read_urldeclared: the model reads links the user pasted without searching the web. It only looks at the last user message, and only the first 10 distinct URLs.
Responses include server_tool_use blocks that show what the server did (search, open a page, find text in a page, read a link), followed by result blocks. Text blocks carry citations pointing at the sources used. For multi-turn chat, send all of these blocks back unchanged, including their signature fields, because read-link content is restored from the signature on the next turn.
As of 18 November 2026 (Beijing time), searches and fetches triggered by the model are no longer billed separately. You pay only for tokens.
What rules does the API enforce?
The tools are deliberately simple, and most deviations return HTTP 400 rather than being ignored. The ones most likely to catch you:
- Per-tool options such as
allowed_domains,blocked_domainsanduser_locationare rejected. You cannot restrict search to certain sites. tool_choicecannot name a web tool. You cannot force a search.tool_choice: "none"turns off every tool, URL reading included.- The built-in tools cannot be mixed with other server tools.
- A reply that used a web tool cannot be continued with prefix completion.
- When web tools or the high safety level are on, sampling options such as
temperature,top_pandstop_sequencesare overridden.max_tokensstill applies, but per inference step, not per request.
If your app depends on any of these, keep your own search pipeline and use function tools instead.
How does file input work with deepseek-flash?
File input is a two-step flow. You upload the file to the Files API, wait for it to be parsed, then reference its ID in a message.
curl https://api.deepseek.com/files \
-H "Authorization: Bearer ${DEEPSEEK_API_KEY}" \
-F purpose="text_recognition" \
-F file="@report.pdf"
Send purpose before file in the form body. The reverse order returns a 400. The upload call does not return until parsing finishes, so set your client timeout to cover both.
The purpose decides how the file is processed:
| Purpose | What you get | Billed |
|---|---|---|
text_recognition | Text only; charts and photos dropped | Per page |
rich_layout_recognition | Text plus figures placed where they appeared | Per page |
user_data | Plain text, code, CSV, JSON, spreadsheets, ebooks | Not billed |
Parsed formats include PDF, Word, PowerPoint and common image types. Spreadsheets and EPUB or MOBI ebooks are converted to Markdown.
Then reference the ID. The Messages format needs a beta header:
curl https://api.deepseek.com/anthropic/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: ${DEEPSEEK_API_KEY}" \
-H "anthropic-beta: files-api-2025-04-14" \
-d '{
"model": "deepseek-flash",
"messages": [{
"role": "user",
"content": [
{"type": "document", "source": {"type": "file", "file_id": "file-api-xxxx"}},
{"type": "text", "text": "List the three biggest risks in this report."}
]
}]
}'
Limits worth writing down: parsed files can be up to 100 MiB and 1,000 pages, uploads and parsing each have a 120-second window, and an account can have 15 parses in progress at once. A single chat request can reference up to 20 documents totalling 8 MiB of text. Oversized context returns an error; nothing is truncated silently. You also cannot download originals or parse results later, so keep your own copy.
What does the safety_check parameter do?
safety_check reviews both the input and the output of a request, images included. It takes one field, level, with two values. low is the default check every request already gets. high turns on stricter review. DeepSeek says apps that serve the public should enable high.
{
"model": "deepseek-flash",
"safety_check": {"level": "high"},
"messages": [{"role": "user", "content": "Hello"}]
}
How a failure shows up matters for your UI:
- Rejected input returns a 400 with no detail about why.
- Rejected output ends the response as a refusal:
stop_reason: "refusal"in Messages,content_filterin Chat Completions, anincompletestatus in Responses. - Streaming: text already streamed cannot be taken back. If a stream ends in a refusal, your client has to replace what it showed with its own message.
Review tokens are billed as output and reported separately as safety_tokens in the usage object, so watch that field when you estimate costs.
What are the standalone APIs?
The same building blocks are also sold separately, for use with any model or none:
| API | List price |
|---|---|
| Search | $0.75 per 1,000 successful requests |
| Fetch | $0.75 per 1,000 successful requests |
| File parsing and OCR | $0.225 per 1,000 pages |
| Text-to-speech | $0.45 per 10,000 characters |
| Speech-to-text | $0.116 per hour of audio |
At launch, speech-to-text and text-to-speech have a limited-time 50% discount. The standalone Search and Fetch APIs stay billed per call, unlike the model-triggered tools. If you are comparing speech options, the Voxtral 3 speech models cover similar ground with a different design.
Key takeaways
- The release adds
deepseek_web_search,deepseek_read_url, file input andsafety_checkto the existing Messages, Responses and Chat Completions endpoints. - Only
deepseek-flashsupports them; turning thinking on switches search into a multi-step deep search. - Configuration is minimal: no domain filters, no forced tool calls, and most extra options return a 400.
- File input means upload to
/fileswithpurposefirst, then reference thefile_id. - Since 18 November, model-triggered search and fetch cost only tokens; the standalone APIs are billed per call.
FAQ
Does DeepSeek web search work with deepseek-v4-pro?
No. The built-in tools, file input and safety_check features of this release are documented for deepseek-flash only.
Can I limit DeepSeek web search to specific domains?
No. allowed_domains and blocked_domains are rejected with a 400. If you need domain control, call your own search service through a function tool.
Do I need to resend search results in later turns?
Yes. Pass the server tool blocks back unchanged, including their signature fields. Read-link page content is restored from the signature on the next turn.