Agent Upstart

Cool things people are building with agents — and practical help getting the most out of them.

Playbooks · Coding tasks

Budget DeepSeek Search and Fetch calls

Written October 29, 2026 · Edited November 10, 2026

For a solo builder or small team × budgeting Search and Fetch calls now that they are billed × DeepSeek Harness, Claude Code, or Codex with the DeepSeek API, ending with a counted cost per task and a cap set against live billing.

Before you start

DeepSeek's Search API finds web pages for a query and returns structured results, and the Fetch API retrieves one page and returns its content as Markdown. Both are raw JSON APIs at https://api.deepseek.com, called with a DeepSeek API key. When you use the DeepSeek API through DeepSeek Harness, Claude Code, or Codex, server-side tool calls already hit the Search and Fetch APIs. Those calls are billed per successful request, at the rates below.

The billing rule is per successful request, not per token and not per result. Search and Fetch each cost $0.75 per 1,000 successful requests, from DeepSeek's pricing page. A request counts only when it returns HTTP 200 and produces a result: Search must return a non-empty results array, and Fetch must return page content. Failed requests, empty search results, and timeouts are not billed. The count field, which controls how many results a Search returns, does not change the price of the call. The $0.75 covers the call itself. Any tokens the fetched text adds to a later model call fall under model pricing, not under the $0.75.

DeepSeek's guide describes no call-count log or usage endpoint for Search and Fetch. The counting below is therefore a manual tally: count the successful calls one task makes, then project. Do not look for a counter in the docs that is not there.

What "done" looks like

At the end of one sitting you have three numbers written down: the successful Search calls and Fetch calls one representative task makes, the cost of one task at $0.75 per 1,000 successful requests for each API, and the projected cost for the number of tasks you expect to run — plus a cap, in dollars, that you will not cross without deciding to raise it.

Steps

  1. Confirm which of your tools makes the server-side calls. The billing note in DeepSeek's guide names three routes: DeepSeek Harness, Claude Code, and Codex, used with the DeepSeek API. If your agent reaches the DeepSeek API through one of those three, its search and fetch calls are the ones this page budgets. If it calls the Search and Fetch endpoints directly, the same per-request rates apply, and the same counting method works.
  2. Run one representative task and tally only successful calls. Pick the task your agent does most often. Watch its run, or read its log, and count each Search call that returned results and each Fetch call that returned page content. A call that failed, timed out, or returned an empty result list costs nothing under the billing rule, so leave it out of the tally. Record the two counts separately: Search calls and Fetch calls are billed separately, at the same rate.
  3. Project the cost per task and per period. Each successful call costs $0.00075. Multiply: (Search calls + Fetch calls) × $0.00075 is the Search and Fetch cost of one task. One Search and one Fetch per task is $0.0015 per task, or $1.50 per 1,000 such tasks. Twenty Searches per task is $0.015 per task. Multiply the per-task cost by the tasks you expect in a day or a week. The DeepSeek Search and Fetch cost projector does this arithmetic from the two counts and a cap.
  4. Set the cap as a balance limit. Search and Fetch fees are deducted from the topped-up balance or granted balance, with the granted balance used first when both exist. Top the account up only to the cap amount you decided in step 3, so the balance itself is the limit: when the balance runs out, the API answers 402, insufficient balance, and the calls stop. Re-check the balance after the first billed week and compare the deduction with the projection from step 3; if the two disagree, recount the calls before raising the cap.
  5. Cut the calls that repeat work. Before raising a cap, remove the calls that buy nothing new: a search repeated for the same question, a fetch of a page already fetched for the same task, and a search run on every step of a task that only needs one. The count field is not a lever here — asking for 50 results costs the same as asking for one — so cut calls, not results per call.

Check the agent's work

What can go wrong

Limits

Related playbooks

Sources

Sources: Search & Fetch guide — DeepSeek API Docs, Models & Pricing — DeepSeek API Docs.

Back to: Coding playbooks hub · Also: Work out what DeepSeek Search and Fetch calls will cost now that per-request billing applies · Token cost calculator