DeepSeek Search & Fetch API: DSH Setup, Cost and Limits

Author
DeepSeekAgent.io Editorial Team
Published
Updated

DeepSeek Search and Fetch split web research into two operations. Search returns ranked web results; Fetch converts a selected URL into Markdown suitable for an Agent context. DeepSeek Harness v0.2.1-rc.2 exposes both through Web Search settings.

Endpoints and authentication

Search:

POST https://api.deepseek.com/v1/tools/search

Fetch:

POST https://api.deepseek.com/v1/tools/fetch

Both use the existing DeepSeek API key as a Bearer token. They are separate from model-chat endpoints and have their own fields, limits, and billing records.

Search requests

query is required and accepts 1–128 Unicode characters. count ranges from 1 to 50 and defaults to 10. Requests can include ori_question, localization, and need_content.

{
  "query": "DeepSeek Harness site:github.com after:2026-10-01",
  "count": 10,
  "need_content": false
}

Operators include site:, -site:, minus exclusions, quoted exact matches, lang:, after:, and before:. A precise Agent workflow starts with site and date constraints instead of requesting 50 broad results.

Results may include title, URL, snippet, summary, content, date, a 0–3 relevance score, and an authority value from -1 to 4. These fields help rank candidates, but citations should still point to and be checked against the original page.

Fetch requests

Fetch accepts a target URL and returns the page title and Markdown content while respecting the target's access policies. Use it after Search selects a small number of useful sources.

In DSH, the efficient sequence is Search to narrow the field, Agent selection, Fetch for full text, then an answer that preserves source URLs. Fetching every result increases latency, cost, and context noise.

Billing and promotional period

Search and Fetch each cost $0.75 per 1,000 successful, non-empty HTTP 200 responses. Empty results, failures, and timeouts are not billed, and Search count does not change the per-call price.

DeepSeek announced free server-side tool calls through DSH, Claude Code, and Codex until November 1, 2026 at 00:00 Beijing time. After that window, track actual call counts and enforce budgets.

Rate limits and retries

Search and Fetch each have a separate account-level limit of 5 QPS. Fetch also has per-domain limits. Errors 400, 401, 402, 403, 404, and 413 usually require changing the request or account state. Retry only 408, 429, and 5xx/504 responses after waiting; an Agent should not loop indefinitely on every error.

Configure DSH

After upgrading to v0.2.1-rc.2, enable DeepSeek Search and Fetch in Web Search settings and enter the relevant account credentials. Test the full chain with a constrained query: search official documentation, choose one result, fetch it, and produce a summary with the source URL.

Also define per-task Search and Fetch caps, allowed domains, retry limits, and a citation requirement. That makes web access an auditable research path rather than unbounded background traffic.

References