Skip to content

Black Friday: up to 61% off our packs until November 30.

See the packs

DeepSeek API Web Search, File Input and Voice: Setup, Real Costs and When to Keep Your Own RAG

A practical guide to DeepSeek's API web search, URL reading, file input with OCR and voice: how to set them up, what they cost once per-query fees sit on top of token rates, and a pilot method for deciding which questions go to built-in tools and which stay on your own retrieval stack.

This guide covers how to set up DeepSeek's API web search, URL reading, file input with OCR and voice, what each answer really costs and a way to decide which questions go where. These features also come with governance duties, which the first section sets out.

What DeepSeek added to the API

Search runs on DeepSeek's own search engine. According to the changelog, DeepSeek Search is an AI-native general-purpose search engine that indexes hundreds of billions of web pages and supports multilingual search.

You can run search with thinking off or on. With thinking enabled, deepseek_web_search works as deep thinking search: over several thinking steps the model searches, opens pages and finds text within them, making up to about 20 tool calls before it answers. That helps with hard research questions. It also means one user question can trigger a lot of billable activity, which the cost and caveat sections return to.

The release also sets a governance condition. DeepSeek's release announcement states that public-facing apps must enable safety checks, and that developers remain responsible for content moderation, applicable model registration and AI-generated content labeling. So public apps must turn the safety check on, but doing so does not hand your compliance work to DeepSeek. Treat this as the governance baseline for everything below.

If you want a working reference, DeepSeek publishes an open-source chat demo on GitHub. The demo stores your API key and settings in the browser's localStorage, and conversations and original attachments in IndexedDB. That works for a local prototype. In production, keep keys on a backend.

Setting up deepseek_web_search and deepseek_read_url on deepseek-flash

Choosing an endpoint

Copy the exact request shape for the endpoint you use from the official Web Tools guide. Treat that guide as the source of truth whenever the API changes, and don't adapt an example written for another provider.

A minimal setup sequence

  1. Keep the key on a backend. The chat demo's browser storage is fine for a local prototype and nothing beyond that.
  2. Start with one tool. Using the request shape from the Web Tools guide, call deepseek-flash with deepseek_web_search enabled and thinking off, then send a small set of real user questions.
  3. Log usage on every request, using a record like the one below.
  4. Add deepseek_read_url separately for fetching specific pages, and test it on its own before you combine the two tools.
  5. Turn thinking on last, and compare the results with your thinking-off baseline.

What to log from day one

The record below is our suggested log format, not DeepSeek's response format. The two token values come from DeepSeek's documentation example; the other values are placeholders you fill from your own traffic.

{
  "route": "public_freshness",
  "endpoint": null,
  "model": "deepseek-flash",
  "thinking": false,
  "tools_enabled": ["deepseek_web_search"],
  "billed_search_queries": null,
  "input_tokens": 9078,
  "cached_input_tokens": 4096,
  "output_tokens": null,
  "latency_ms": null,
  "peak_hours": null,
  "answer_useful": null
}

Watch three fields most closely: billed queries, input tokens and whether the answer helped. The cost analysis later in this guide depends on them.

Thinking on vs off

Deep thinking search gives you more depth but less predictability.

Mixing with your own function tools

MxChat reported that in its testing, a bot that already uses function tools, for example for order lookups or forms, could not add DeepSeek web search with thinking off. We suggest confirming this on your own account before you rely on it. If it holds for you, an assistant that already calls your tools can only add built-in search in thinking mode, and it takes on that mode's latency and cost profile.

What you cannot configure

The built-in search tool rejects the allowed_domains, blocked_domains and user_location options, so you cannot restrict results to particular sites through the tool. If your requirement reads 'only cite our documentation and these three regulators', the built-in tool can't meet it.

Standalone Search and Fetch APIs

DeepSeek also offers search and fetch as standalone APIs. These have account-level limits of 100 queries per second for search and 25 for fetch, separate from model concurrency limits. Compare those limits with your peak traffic, not your average, because the average will mislead you.

File input and OCR: limits and billing

The Files API sets size limits by file type.

File typeSize limit
Images64 MiB
Documents such as PDF, Word and PowerPoint100 MiB
Plain text, spreadsheets and ebooks32 MiB

According to the OCR guide, OCR is billed by the number of pages recognized successfully, and a recognition that fails or times out is not billed. Check the pricing page for current fees before you build a budget.

File input works best for one-off document Q&A, where a user uploads a contract or a scanned form and asks about it. Teams that need a persistent, versioned knowledge base with access controls, a chunking strategy, freshness rules and citation tracking will likely still need to build that layer themselves. Our guide to chunking PDF tables without losing their source covers the provenance side of that work.

Voice: speech-to-text and text-to-speech

Start with language coverage. According to DeepSeek's documentation, speech recognition supports 21 languages including Russian, while speech synthesis supports 10 languages, and Russian is not among them. In practice, a product could accept a spoken question in a language it cannot answer out loud. Coverage may grow, so watch the changelog and confirm your target languages in DeepSeek's speech documentation before you commit.

Voice costs need the same attention. In MxChat's single sample, reading a 213-character answer aloud cost about $0.0096 at list price, while generating that answer on deepseek-flash cost about $0.0006, so speech output cost about 16 times the text generation. One short sample is not a forecast, but it does show that voice output can cost more than the text it reads, so model it separately.

What DeepSeek web search really costs: tool fees on top of token rates

The per-search fee is only one line of the bill.

Token rates and peak hours

Off-peak rates are half of peak rates. Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday through Friday, excluding Chinese public holidays.

Billing behavior to design around

Web search is billed per query, not per call. A search call that returns results is billed for each of its queries, so a call with three queries counts as three. A call that fails or returns no results is not billed. That means your budget has to rest on the number of queries the model actually issues, and logging real traffic is the only way to find that number. Per-request tracing, as described in our OpenTelemetry GenAI tracing playbook, gives you a record of tool calls and token counts to build that budget on.

What the discounts do not cover

Search fees do not get cheaper off-peak or with caching, because DeepSeek's half-price hours and cache discount apply to tokens only. The search portion of the bill stays the same at any hour.

Context growth

Search also makes your context bigger. In the documentation example, one search request used 9,078 input tokens plus 4,096 cached tokens. Page content the model retrieves becomes input, and you pay for input.

What MxChat's test found

MxChat tested searched and unsearched answers on deepseek-flash.

Metric (MxChat test)Without searchWith search
Billed searches per answerNone2.9 on average
Input tokens per answer4,07013,803
Cost per 1,000 answers, off-peak$0.63$3.64
Search fees as share of billNot applicable60%

In MxChat's test, searched answers triggered 2.9 billed searches on average, and input tokens per answer rose from 4,070 without search to 13,803 with it. Off-peak, 1,000 answers cost $0.63 without search and $3.64 with search, and search fees made up 60% of the bill. Put another way, a searched answer cost nearly six times as much as an unsearched one in this test, and most of that came from per-query fees and extra input tokens, not from the answer itself.

Market context

Anthropic lists its Claude web search tool at $10 per 1,000 searches and OpenAI lists its web search tool at $10 per 1,000 calls, both plus token costs. We suggest comparing those list prices with DeepSeek's current per-query fee on its pricing page. Keep in mind that the fee per search is only part of the comparison. How many queries each answer triggers, and how much each search adds to the context, can matter just as much.

The Route-by-Question-Type Pilot

The pricing page alone won't give you a decision. The method below, which we call the Route-by-Question-Type Pilot, is a short test on your own traffic. Instead of one yes or no for the whole product, it ends with a routing decision for each kind of question. It is a method we suggest, not a published benchmark.

  1. Sample real questions. Pull a representative set from your logs and sort them into three types: questions that need fresh public web content, questions about uploaded documents, and questions that depend on private knowledge.
  2. Run every question in four configurations. Tools off and on, each with thinking on and off, logged with the record from the setup section.
  3. Leave your production system prompt alone. In MxChat's test, a restrictive support prompt mostly suppressed search: the bot searched in only 2 of 16 answers. In one of those two, it ran three billed searches, was billed for 12,829 input tokens and still replied that it did not have enough information in its knowledge base.
  4. Score paid-but-unhelpful answers. With thinking off, MxChat found that 6 of 20 searched answers, 30%, were paid for and did not help. Track this rate on your own data, because it raises the cost of every useful answer without showing up as a separate line item.
  5. Price at peak and off-peak. Apply both token rates, then add the per-query tool fees, which are never discounted.
  6. Settle governance before launch. Name an owner for each duty in the governance baseline described near the top of this guide.
  7. Decide per question type. You will likely send some types to built-in tools and keep the rest on your own retrieval.

Pre-launch checklist

  • [ ] Request shapes copied from the Web Tools guide for your endpoint
  • [ ] Thinking mode chosen per route, with latency measured
  • [ ] Function tool compatibility tested on your own account
  • [ ] Budget built per query, including input token growth
  • [ ] Voice costs modeled at list price and TTS languages checked against target markets
  • [ ] Standalone API rate limits checked against peak traffic
  • [ ] Safety checks enabled and governance owners assigned
  • [ ] DeepSeek Privacy Policy reviewed by legal, after confirming with DeepSeek that the linked version is still current

Decision matrix: built-in tools vs your own RAG

Use this table to read the results of your pilot.

DimensionBuilt-in DeepSeek toolsYour own RAG
Data sourcePublic web via DeepSeek's index; uploaded filesAny corpus you control, including private data
Source controlNo domain allowlists, blocklists or location targetingFull control over sources and ranking
AuditabilityLimited to what the model and tool returnYou define logging, versioning and citation trails
ResidencyReview the provider's data handling against your residency rules before launchCan be designed around your residency rules
Cost predictabilityVaries with queries per answer and context growthMostly fixed infrastructure plus tokens
Ops effortLow; no crawler, index or OCR to runHigher; you build and maintain the pipeline
ThroughputAccount-level search and fetch caps on the standalone APIs (see setup section)Scales with the infrastructure you provision
JavaScript-heavy pagesTest on your own target pages before relying on itDepends on your fetcher and rendering setup

Where built-in tools tend to win

Built-in tools make sense for fresh public web answers and for multilingual search over a large public index. They also suit low-volume or exploratory features, ad hoc file Q&A, and teams that have no retrieval infrastructure yet.

Where your own RAG tends to win

Your own stack is the better choice for private or internal corpora that a public engine can't see. It also wins when you need domain allowlists or blocklists, strict source control with audit trails, or when residency rules and contracts restrict where data can go. Because the built-in tool rejects domain and location filters, you cannot guarantee which sources ground an answer.

Hybrid

For many products the realistic answer is both, and the pilot tells you where to split them. Keep your own retrieval for private knowledge and expose built-in search only to the question types that need fresh public information.

Caveats and open questions

The per-answer cost figures in this guide come from MxChat's test, so treat them as one data point rather than a forecast.

Prices, promotions and limits may change, so check the pricing page and changelog before you commit.

Deep thinking search fans out into many tool calls, so latency and cost per answer will vary widely. Set timeouts and per-request budget guards, either in your own code or in a routing layer like the one in our Vercel AI Gateway playbook.

Confirm that the linked version is current, then check it against your contracts and regulatory requirements. Our inference-provider risk checklist lists more questions worth asking any model vendor.

Key Takeaways

  1. DeepSeek's search tools run on its in-house search engine, which indexes hundreds of billions of web pages.
  2. DeepSeek API web search is billed per query, not per call, and the off-peak and caching discounts apply only to tokens, never to search fees.
  3. In MxChat's independent test, searched answers cost $3.64 per 1,000 off-peak versus $0.63 without search, and search fees made up 60% of the bill.
  4. The built-in search tool rejects domain and location filters, and MxChat found that adding web search alongside your own function tools only worked in thinking mode.
  5. In MxChat's single sample, text-to-speech cost about 16 times the text generation; speech synthesis covers 10 languages against 21 for speech recognition.
  6. Public-facing apps must enable safety checks, but moderation, registration and AI content labeling remain the developer's job.
  7. Run a Route-by-Question-Type Pilot: built-in tools suit fresh public web and ad hoc files, while private corpora, source control, auditability and residency point to your own RAG.

Conclusion

DeepSeek's built-in tools let you add live web search, file reading and voice to an LLM product without running your own crawler, index or OCR pipeline. The per-search fee is only one part of the bill, though. What you actually pay depends on how many queries each answer triggers, how much the context grows, how many searches don't help and what voice output costs, and early independent testing suggests search fees can be the largest share. Test some constraints instead of assuming them: there are no domain or location filters, combining search with your own function tools reportedly requires thinking mode, and the governance duties remain yours.

So run the Route-by-Question-Type Pilot on your own traffic with your real system prompt, price it at both peak and off-peak rates, and send each question type to whichever option serves it best. For most teams that ends up as a hybrid, with built-in search handling fresh public information and your own retrieval handling anything private, controlled or audited. If a second pair of eyes on your pilot design or cost model would help, the Optijara team is happy to talk it through.

Frequently Asked Questions

How much does DeepSeek's built-in web search cost compared with OpenAI and Anthropic?

Anthropic lists its Claude web search tool at $10 per 1,000 searches and OpenAI lists its web search tool at $10 per 1,000 calls, both plus token costs. Check DeepSeek's pricing page for its current per-query search fee. DeepSeek bills per query, so a call with three queries counts as three, and failed or empty searches are not billed. The real cost per useful answer depends on how many queries the model issues and how much search content it adds to input tokens.

Do DeepSeek's off-peak discounts apply to web search and fetch fees?

No. Off-peak token rates are half of peak, with peak hours from 01:00 to 04:00 and 06:00 to 10:00 UTC on weekdays, excluding Chinese public holidays. DeepSeek's half-price hours and its cache discount apply only to tokens, so search fees are the same at any time of day.

Can I limit DeepSeek web search to specific domains or a country?

Not through the built-in tool. It rejects the allowed_domains, blocked_domains and user_location options, so you cannot restrict results to particular sites. If you need source allowlists, blocklists or location targeting, keep that retrieval in your own pipeline.

Can I use DeepSeek web search together with my own function tools?

Possibly, but test it first. In MxChat's testing, a bot already using function tools, for example for order lookups or forms, could not add DeepSeek web search with thinking off, so the combination only worked in thinking mode. We suggest confirming this on your own account. In thinking mode, deep thinking search can make up to about 20 tool calls before answering, so expect latency and cost to vary more.

What file sizes does the DeepSeek Files API accept, and how is OCR billed?

Images can be up to 64 MiB, documents such as PDF, Word and PowerPoint up to 100 MiB, and plain text, spreadsheets and ebooks up to 32 MiB. OCR is billed by the number of pages recognized successfully; failed or timed-out recognitions are not billed. Check the pricing page for current fees before you budget.

Should I replace my RAG pipeline with DeepSeek's built-in tools?

Usually not entirely. Built-in tools suit fresh public web questions, multilingual search and ad hoc file Q&A. Your own RAG is still the better fit for private corpora, domain control, audit trails and residency requirements. Run a Route-by-Question-Type Pilot on real questions with your production prompt unchanged. In MxChat's test, a restrictive prompt mostly suppressed search, and with thinking off 30% of searched answers were billed but did not help. Route by question type instead of switching the whole product.

Sources

  1. https://api-docs.deepseek.com/news/news261113/
  2. https://api-docs.deepseek.com/quick_start/pricing/
  3. https://api-docs.deepseek.com/guides/web_tools/
  4. https://api-docs.deepseek.com/guides/build_a_chatbot/
  5. https://api-docs.deepseek.com/guides/files_api/
  6. https://api-docs.deepseek.com/guides/ocr/
  7. https://api-docs.deepseek.com/updates/
  8. https://github.com/deepseek-ai/chat-demo
  9. https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy-2025-02-14.html
  10. https://mxchat.ai/deepseek-web-search-api-pricing-chatbot-test/
  11. https://www.datastudios.org/post/deepseek-api-web-search-ocr-voice-0-75-per-1000-searches
  12. https://tproger.ru/news/deepseek-otkryla-v-api-poisk-chtenie-fajlov-i-golos-iz-svoego-pr

Share this article

Hamza Diaz

Written by

Hamza Diaz

Hamza Diaz is the founder of Optijara, where he builds practical AI agents, automation systems, and Copilot workflows for service businesses. He writes about AI operations, agent strategy, and real-world implementation for teams that want usable systems instead of hype.

All articles

Next step

Have something to build?

Tell us what you need. We reply with a clear scope and a fixed quote.