Skip to content

Cost and FinOpsGuide

What server-side tools cost an AI agent: search, fetch, sandboxes

An agent that searches the web pays twice: a fee per search, and the tokens the results add to every later turn. DeepSeek starts billing its server-side tool calls on 31 October. Here is what each provider charges for hosted tools, how to count calls, and the parameters that cap them.

By INFRO Editorial

Published

7 min read

An amber arc tracing most of the way around a glowing elliptical loop on a dark ground, with small glass pods spaced along the ring and a lit hub at its centre

In short

Server-side tools bill on top of tokens. As of 27 October 2026, OpenAI and Anthropic charge $10 per 1,000 web searches, Gemini charges $14 per 1,000 grounding queries after 5,000 free a month, and DeepSeek's Search and Fetch APIs cost $0.75 per 1,000 successful calls each, billed for calls made through DeepSeek Harness, Claude Code and Codex from 31 October at 16:00 UTC. Search results then re-enter context as input tokens on every later turn, which usually costs more than the search fee. Count calls from each provider's usage fields and cap them with max_uses, max_tool_calls or a run-level guard.

Key takeaways

  • Hosted web search costs $10 per 1,000 calls at OpenAI and Anthropic, $14 per 1,000 queries at Gemini after a monthly free allowance, and $0.75 per 1,000 at DeepSeek, which starts billing agent-harness calls on 31 October 2026 at 16:00 UTC.
  • The bigger cost is usually the results: Anthropic and OpenAI bill retrieved content as input tokens, and in an agent loop that content is re-read on every later turn.
  • Sandboxes bill by time and memory: OpenAI containers from $0.03 per 20-minute session for 1 GB; Anthropic code execution is free with its newer search and fetch tools and otherwise $0.05 per container-hour after 1,550 free hours.
  • Count calls from the response, not from your own logs: Anthropic reports usage.server_tool_use.web_search_requests, OpenAI emits web_search_call items, and Gemini may run several queries per request.
  • Cap per request with Anthropic's max_uses or OpenAI's max_tool_calls, and per run with a guard in your own loop; neither provider cap knows about the rest of the run.

A server-side tool is one the provider runs for you inside the model call: web search, page fetch, a code sandbox. Each has its own price on top of tokens, and in October 2026 the per-call rates run from $0.75 to $14 per 1,000 calls. The fee is rarely the largest part of the bill. What a search returns becomes input tokens, and in an agent loop those tokens are re-read on every later turn. This guide lists what each provider charges, works through one agent run, and shows how to count and cap tool calls before a loop does it for you.

The timing is not abstract. DeepSeek opened its Search and Fetch APIs on 17 October at $0.75 per 1,000 calls per endpoint, and said the server-side tool calls its models make through DeepSeek Harness, Claude Code and Codex, free until now, start billing on 31 October 2026 at 16:00 UTC12. Teams running coding agents on DeepSeek get a new line item next week.

What each provider charges for hosted tools

ProviderToolPriceWhat else bills
OpenAIWeb search (web_search, all models)$10 per 1,000 callsSearch content tokens at the model's rates3
OpenAIWeb search preview, non-reasoning models$25 per 1,000 callsSearch content tokens free3
OpenAIFile search$2.50 per 1,000 calls; storage $0.10 per GB a day, 1 GB freeRetrieved tokens3
OpenAIHosted Shell and Code Interpreter containers$0.03 (1 GB), $0.12 (4 GB), $0.48 (16 GB), $1.92 (64 GB) per 20-minute sessionModel tokens3
AnthropicWeb search$10 per 1,000 searchesResults as input tokens, this turn and later turns4
AnthropicWeb fetchNo extra chargeFetched content as tokens4
AnthropicCode executionFree with web_search_20260209 or web_fetch_20260209 and later; otherwise 1,550 free hours a month, then $0.05 per container-hourModel tokens4
GoogleGrounding with Google Search (Gemini 3 and newer)5,000 free requests a month, then $14 per 1,000One request can run several billed queries5
DeepSeekSearch API, Fetch API$0.75 per 1,000 successful requests eachResults the agent passes back as model tokens6
AWS BedrockWeb Search (Responses API on bedrock-mantle)Charged per query; no rate shown on the pricing page readObservations as input tokens78
Server-side tool prices on each provider's pricing page, read 2026-10-27.

A few billing rules change the arithmetic more than the headline rate does.

What counts as a call. Anthropic counts each web search as one use "regardless of the number of results returned", and does not bill a search that errors4. DeepSeek bills a request only when it returns HTTP 200 with a result: "Failed requests, empty search results, and timeouts are not billed", and the count of results does not change the price6. Google warns that one customer request "may result in one or more queries to Google Search", each billed5.

Where the results go. Anthropic says search results "are counted as input tokens, in search iterations run during a single turn and in subsequent conversation turns"4. OpenAI defines web search content tokens as "tokens retrieved from the search index and fed to the model alongside your prompt"3. Bedrock's search_context_size sets how many observations a search returns, 5, 11 or 25, and AWS notes it "does not limit how many Search calls the model can make"8.

Idle sandboxes. Since 9 October, OpenAI bills hosted sandbox compute in the Agents API only during active turns, not for idle time between turns, and added pre-warming9. Those sandboxes use the standard container rates; sizes run from small (1 vCPU, 1 GB) to large (4 vCPU, 16 GB), with medium the default10. Eligible container sessions bill by the minute with a 5-minute minimum3.

What one agent run costs

The lesson for budgeting is to model three numbers per run, not one: calls per run, tokens each call returns, and how many later turns carry those tokens. A lower per-search fee does not help much if the agent pastes ten full pages into context and keeps them there.

Anthropic offers two levers aimed at this. With web_search_20260209 and later, Claude writes code that filters results before they reach the context window, which Anthropic says "reduces token use on search-heavy requests", with no extra charge for the code execution this needs114. And response_inclusion: "excluded" drops nested search and fetch result blocks from the response when a completed code execution call already consumed them, reducing output token costs1112.

How to count tool calls

Count from what the provider reports, per request, and attach the count to the run:

  1. Anthropic. Read usage.server_tool_use.web_search_requests on each response11.
  2. OpenAI. Count web_search_call output items whose action is search; OpenAI notes that search actions incur the tool call cost13. Container sessions are counted by time, not by call.
  3. Gemini. Count grounding queries, not requests, because one request can trigger several billed queries5.
  4. DeepSeek. Count successful Search and Fetch requests; if your harness calls the APIs directly, your own HTTP log is the count, and from 31 October so is DeepSeek's bill6.
  5. Bedrock. Billing is per query7; AWS also records Web Search activity as CloudTrail data events when that logging is on8.

Then sum per run. A per-request count tells you whether one call misbehaved; a per-run count tells you whether the agent design is affordable.

How to cap them

Per request. Anthropic's web search and web fetch tools take max_uses; past it, the tool result is an error with code max_uses_exceeded11. OpenAI's Responses API takes max_tool_calls, "the maximum number of total calls to built-in tools that can be processed in a response", applied across all built-in tools together; further attempts are ignored14. OpenAI's return_token_budget controls how much search content a run may return, and its unlimited setting "can increase latency and cost"13.

Per source. Domain filters shrink what a search can pull in. OpenAI's web_search takes up to 100 allowed_domains or blocked_domains13; Anthropic takes allowed_domains or blocked_domains, not both11; and since 23 October Bedrock Web Search takes up to 100 allowed or 100 blocked domains plus an optional user location, in US East (N. Virginia), US East (Ohio), US West (Oregon) and AWS GovCloud (US-West)15.

Per run. No provider cap knows what the rest of the run already spent. Keep a counter in your agent loop for tool calls and for input tokens, and end the run when either passes its limit. The run guard in the agent loops guide does this for steps, tokens and wall-clock time; add tool calls to the same guard.

Per account. DeepSeek enforces Search and Fetch rate limits per account, independently of each other and of model concurrency, and answers 429 past them6. A shared account means one runaway agent can throttle every other team's searches.

What to ask before turning on hosted tools

  • Which tools does each agent actually need, and is a lower-priced or free option available (Anthropic's web fetch, DeepSeek's APIs) for the same job?
  • What is our expected calls-per-run, and what is the ceiling we will enforce?
  • Do results stay in context for the rest of the run, or does the agent summarise and drop them?
  • Who sees the provider's tool line items each month, and do they reach the same budget owner as the token spend?

Keeping agent runs inside a budget with INFRO

INFRO is a control plane in front of the provider accounts you already hold; your providers bill you directly, including for every hosted tool, and INFRO's charge is a software subscription.

For model calls that pass through it, INFRO helps with the token side of this problem. Tag each call with metadata.trace_id, workflow and step, and GET /v1/traces/{trace_id} returns every request in the run with its estimated provider cost, so the growth in input tokens from re-read results shows step by step (tracing an agent run). A gateway key per agent can carry a spend limit, checked before each call, so a loop stops at a ceiling rather than at the invoice. For tools you host yourself as MCP servers, INFRO's MCP gateway records each tool call on the trace and enforces per-key and per-server rate limits.

What it does not do: INFRO's estimates are built from the tokens and units it can see, and they exclude provider-side surcharges such as a web search fee, a grounding query or a container session. Its budgets act on that estimate, not on the provider's invoice. Keep the provider's own usage reports and billing alerts on for hosted tools.

Questions readers ask

How much does web search cost in the OpenAI and Claude APIs?
Both list $10 per 1,000 calls as of 27 October 2026, plus tokens. OpenAI bills the search content tokens at the model's rates for its current web_search tool; Anthropic bills search results as input tokens, in the turn that searched and in every later turn that carries them. OpenAI's older web_search_preview tool on non-reasoning models is $25 per 1,000 calls with content tokens free.
When does DeepSeek start charging for tool calls?
DeepSeek's release note says Search and Fetch calls made through server-side tools in DeepSeek Harness, Claude Code and Codex are free until billing starts on 31 October 2026 at 16:00 UTC (00:00 Beijing time on 1 November). Each endpoint costs $0.75 per 1,000 successful requests; failed requests, empty search results and timeouts are not billed.
How do I limit how many times an agent searches?
Per request, Anthropic's web search and web fetch tools take max_uses, and OpenAI's Responses API takes max_tool_calls, which caps all built-in tool calls in one response together. Per run, keep a counter in your own agent loop and stop the run when it passes your limit; a provider's per-request cap does not know how many requests the run has already made.
Is code execution billed per call?
No, by time. OpenAI bills Hosted Shell and Code Interpreter containers by memory size per 20-minute session, by the minute with a 5-minute minimum for eligible sessions, and its hosted sandboxes in the Agents API now bill only during active turns. Anthropic's code execution is free when used with its newer web search or web fetch tool versions; otherwise each organization gets 1,550 free hours a month and then pays $0.05 per container-hour.
Does INFRO include web search fees in its cost estimates?
No. INFRO estimates provider cost from tokens and units it can see in each request. Provider-side surcharges such as a built-in web search fee or a container session are outside that estimate, so its budgets act on a figure that excludes them. Keep the provider's own usage reports and billing alerts for those charges.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.DeepSeek-V4.1-Flash-1017 release (opens in a new tab) — DeepSeek. Accessed Oct 27, 2026.
  2. 2.Models & Pricing (opens in a new tab) — DeepSeek. Accessed Oct 27, 2026.
  3. 3.Pricing (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  4. 4.Pricing (opens in a new tab) — Anthropic. Accessed Oct 27, 2026.
  5. 5.Gemini Developer API pricing (opens in a new tab) — Google. Accessed Oct 27, 2026.
  6. 7.Amazon Bedrock pricing (opens in a new tab) — AWS. Accessed Oct 27, 2026.
  7. 9.Changelog (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  8. 10.OpenAI-hosted sandboxes (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  9. 12.Web fetch tool (opens in a new tab) — Anthropic. Accessed Oct 27, 2026.
  10. 14.Responses API reference (opens in a new tab) — OpenAI. Accessed Oct 27, 2026.
  11. 15.Web Search on Amazon Bedrock now supports domain filtering and user location controls (opens in a new tab) — AWS. Accessed Oct 27, 2026.

About this article

Prices, billing rules and parameters were read on 2026-10-27 from OpenAI's pricing page, web search guide, Responses API reference, OpenAI-hosted sandbox guide and changelog; Anthropic's pricing page and web search and web fetch tool docs; Google's Gemini API pricing page; DeepSeek's pricing page, Search and Fetch guide and V4.1-Flash-1017 release note; and AWS's Bedrock Web Search guide, launch announcement and pricing page. The agent-run arithmetic is illustrative, at list rates, with assumed token counts. INFRO behaviour is described from its documentation and gateway source.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.