DeepSeek Search API: $0.75 per 1,000 Calls, PHP Guide
The DeepSeek Search API costs $0.75 per 1,000 calls, 6.7x cheaper than Brave. See limits, error codes and a PHP client before billing starts Oct 31.
- What: DeepSeek opened a Search API and a Fetch API on October 17, 2026, each at $0.75 per 1,000 successful calls.
- Why it matters: Brave, Exa and Tavily list $5 to $12 per 1,000 calls, so agent search costs drop sharply.
- What to do: Wrap it behind a cache and a retry policy, then test result quality before switching.
- Key stat: Billing starts at 16:00 UTC on October 31, 2026, so the free window closes in twelve days.
The DeepSeek Search API is a paid web search endpoint for AI agents, priced at $0.75 per 1,000 successful requests, with a companion Fetch API that returns pages as Markdown. Both allow 5 requests per second per account. Failed, empty and timed-out calls are not billed. Per-request billing begins on November 1, 2026, Beijing time.
The DeepSeek Search API is an HTTP endpoint at /v1/tools/search that returns ranked web results with titles, URLs, snippets, summaries and authority scores. Its companion, the Fetch API, accepts a public URL and returns the page body as Markdown. Both authenticate with a standard DeepSeek bearer key.
The DeepSeek Search API landed on October 17, 2026, and it reached 428 points on Hacker News within ten hours. I understand why. Every agent I build for clients burns most of its budget on retrieval, not on model tokens. A research agent that runs 10,000 searches a day at $5 per 1,000 calls pays $50 daily before it writes a single word. At $0.75 the same traffic costs $7.50. That gap changes which agents are worth building. This guide covers the endpoints, the real limits, a PHP client you can paste into a project, and the traps I would avoid. I could not run a live benchmark yet, so every price and limit below comes from DeepSeek’s own documentation.
What does the DeepSeek Search API actually cost?
The DeepSeek Search API costs $0.75 per 1,000 successful requests, and the Fetch API costs the same, billed as a separate meter.
Billing only applies to HTTP 200 responses that return a result. Empty result sets, timeouts and errors are free, and the count parameter does not change the price. You can read the exact rules on the DeepSeek pricing page. Server-side calls made through DeepSeek Harness, Claude Code or Codex are free until 16:00 UTC on October 31, 2026. After that, every call is metered.
For context, Brave lists $5 per 1,000 calls. Exa lists $7 for standard search and $12 for deep search. Tavily ranges from $5 to $8 depending on plan. DeepSeek is therefore 6.7 times cheaper than the next cheapest option in that group. These competitor figures come from vendor pages as cited by press coverage, so recheck them before you commit.
How fast do the savings add up?
Cost scales linearly, so the maths is simple. At 10,000 searches per day, DeepSeek costs $7.50 per day, or about $225 per month. The same volume on a $5 provider costs $1,500 per month. One search plus three fetches per agent turn is four billable calls, or $0.003 per turn. A 100,000-turn month costs $300 in retrieval alone. That is cheap, but it is not free, so budget for it. My post on AI agent budget guards shows how to cap that spend per run.
How do you call the DeepSeek Search API from PHP?
You send a JSON POST to https://api.deepseek.com/v1/tools/search with a bearer token and a query field of 1 to 128 characters.
Here are the steps I use in a new project:
- Create a DeepSeek API key and store it in an environment variable, never in code.
- POST to
/v1/tools/searchwithquery, and optionallycount(1 to 50, default 10). - Set
need_contenttotrueonly when you need full page text, since it isfalseby default. - Read the
resultsarray. Each item carriestitle,url,snippet,summaryandrerank_score. - Send promising URLs to
/v1/tools/fetchto get Markdown.
The summary field runs roughly 600 to 800 characters and is written for model consumption. The snippet field is only 100 to 200 characters and is meant for UI display. For most agents, the summary is enough, which means you can skip many Fetch calls and save money.
What does a production-ready PHP client look like?
A production client needs a cache, a retry rule and a hard cap on query length. This is the class I would start from. It follows the retry guidance in the official Search and Fetch guide: retry 408, 429 and 5xx, and fail fast on other 4xx codes.
<?php
final class DeepSeekTools
{
private const BASE = 'https://api.deepseek.com/v1/tools/';
public function __construct(
private string $apiKey,
private string $cacheDir = '/tmp/ds-cache',
private int $ttl = 3600
) {}
public function search(string $query, int $count = 5): array
{
$query = mb_substr(trim($query), 0, 128); // API limit: 128 chars
return $this->cached('search', ['query' => $query, 'count' => $count]);
}
public function fetch(string $url): array
{
return $this->cached('fetch', ['url' => $url]);
}
private function cached(string $tool, array $body): array
{
@mkdir($this->cacheDir, 0775, true);
$file = $this->cacheDir . '/' . sha1($tool . json_encode($body)) . '.json';
if (is_file($file) && filemtime($file) > time() - $this->ttl) {
return json_decode(file_get_contents($file), true);
}
$data = $this->post($tool, $body);
file_put_contents($file, json_encode($data));
return $data;
}
private function post(string $tool, array $body): array
{
$delay = 1;
for ($attempt = 1; $attempt <= 3; $attempt++) {
$ch = curl_init(self::BASE . $tool);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 20,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $this->apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($body),
]);
$raw = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($code === 200) {
return json_decode($raw, true);
}
// Retry only what the docs say is retryable.
if (in_array($code, [408, 429, 500, 502, 503, 504], true)) {
sleep($delay);
$delay *= 2;
continue;
}
throw new RuntimeException("DeepSeek tool error $code: $raw");
}
throw new RuntimeException('DeepSeek tool: retries exhausted');
}
}
The cache is the part most tutorials skip. In my experience agents repeat the same query three or four times in a single run. A one-hour file cache removed roughly a third of my billable calls in a test workflow. That is my own rough measurement on one agent, not a benchmark. Measure yours.
What are the DeepSeek Search API rate limits and error codes?
Search and Fetch each allow 5 requests per second per account, and the two quotas are independent.
The limit applies per account, not per key. Creating extra keys will not raise it. Fetch also enforces a per-domain QPS limit, so hammering one site returns 429 even when your global rate looks fine. The HTTP 429 status is the standard signal here, and the right response is to back off, not to retry instantly.
The error codes worth handling are these. 402 means your balance is empty. 403 means Fetch rejected the URL under a security policy. 404 means Fetch found no usable content. 429 means a rate limit. 504 means a downstream timeout. Only 408, 429 and 5xx deserve retries. A retry loop that fires three calls per failure triples your cost on any error that does get billed, so keep the loop short.
Is the DeepSeek Search API better than Brave, Exa or Tavily?
It is cheaper, but nobody has published independent quality or latency numbers yet, so cheaper does not mean better.
DeepSeek claims its index covers hundreds of billions of pages and filters SEO spam and low-quality AI-generated content. Those are vendor claims. Each result also includes a rerank_score from 0 to 3, where 1.5 or higher counts as high quality. It includes an authority score from 0 to 4 as well, where 3 or higher is highly authoritative. These two fields let you filter results in code. I would drop anything under 1.5 before it reaches the model.
Specialised domains are the weak spot to test first. A general index can underperform on academic papers, code search and legal filings. If your agent lives in one of those areas, run 50 real queries through both providers and compare by hand.
| Option | Listed price | Complexity | When to use |
|---|---|---|---|
| DeepSeek Search API | $0.75 (5 QPS limit) | Low, plain JSON over HTTPS | High-volume agents where cost dominates |
| Brave Search API | $5 | Low | Independent index, privacy-sensitive work |
| Tavily | $5 to $8 | Low, built for agents | Teams that want agent-tuned output today |
| Exa | $7 standard, $12 deep | Medium | Semantic and research-style queries |
What are the risks of building on the DeepSeek Search API?
The biggest risk is lock-in after the free window, followed by prompt injection from fetched pages and data-governance questions.
First, the free period ends on October 31 at 16:00 UTC. Any prototype you build now will start costing money overnight, so put a spend alert in place before that date. Second, a Fetch call returns untrusted web text. Treat it like user input. The same attacks I described in AI browser agent security apply here: a page can contain instructions aimed at your agent. Strip or fence fetched content before it enters a prompt.
Third, the regulatory picture is moving. On October 16, 2026, China’s commerce and science ministries proposed export controls on 23 AI technologies. The draft reportedly exempts API and SaaS access. That is reassuring today but not a guarantee. Keep a second provider behind an interface so you can switch in an afternoon. If you coordinate several tools in one workflow, my guide to agent orchestration covers where that abstraction should live.
The NexGismo verdict: Use the DeepSeek Search API for high-volume, low-stakes retrieval where a 6.7x price cut matters, and keep a pricier provider as a fallback for quality-critical queries. Do not rip out your current provider this week. Run 50 of your real queries through both, filter on rerank_score of 1.5 or higher, and switch only if the answers hold up.
- The DeepSeek Search API and Fetch API each cost $0.75 per 1,000 successful requests, with billing starting at 16:00 UTC on October 31, 2026.
- Both endpoints are limited to 5 requests per second per account, and Fetch adds a per-domain limit.
- Only HTTP 200 responses with a non-empty result are billed, so errors, empty results and timeouts cost nothing.
- The search query field accepts 1 to 128 characters, and the count field accepts 1 to 50 results, defaulting to 10.
- A rerank_score of 1.5 or higher marks a high-quality result, and an authority score of 3 or higher marks a highly authoritative source.
- At 10,000 searches per day, DeepSeek costs about $7.50 per day, compared with roughly $50 per day at $5 per 1,000 calls.
Frequently Asked Questions
How much does the DeepSeek search API cost?
The DeepSeek Search API costs $0.75 per 1,000 successful requests. The Fetch API costs the same and is billed separately. Only HTTP 200 responses with results are charged. Free server-side use through DeepSeek Harness, Claude Code and Codex ends at 16:00 UTC on October 31, 2026.
What is the DeepSeek Fetch API?
The Fetch API is a POST endpoint at /v1/tools/fetch. You send a public HTTP or HTTPS URL of up to 8,192 characters. It returns a JSON object with a title and the page content converted to Markdown. Non-public addresses are rejected by a security policy.
What are the rate limits for the DeepSeek search API?
Search is limited to 5 requests per second per account. Fetch is also limited to 5 requests per second, plus a per-domain limit. The two quotas are independent and apply across all API keys. Exceeding either returns HTTP 429, which you should retry after waiting.
Is the DeepSeek search API cheaper than Brave or Tavily?
Yes, on listed prices. DeepSeek charges $0.75 per 1,000 calls. Brave lists $5, Tavily lists $5 to $8, and Exa lists $7 to $12. That makes DeepSeek about 6.7 times cheaper than the next cheapest option. Result quality and latency have not been independently benchmarked yet.
Can I use the DeepSeek search API with Claude Code?
Yes. DeepSeek states that server-side Search and Fetch calls made through DeepSeek Harness, Claude Code or Codex are currently free for API users. That free window ends on October 31, 2026 at 16:00 UTC. After that, those calls are billed at $0.75 per 1,000.
The DeepSeek Search API is the first retrieval price cut big enough to change agent economics, not just shave a few percent off a bill. My advice is simple. Build the provider-agnostic wrapper now, cache aggressively, and test quality on your own queries before the free window closes on October 31. If the results hold up, you will cut retrieval spend by an order of magnitude. If they do not, you will have lost an afternoon, not a migration. I will publish real latency and quality numbers here once I have run the comparison on production traffic.