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
| Provider | Tool | Price | What else bills |
|---|---|---|---|
| OpenAI | Web search (web_search, all models) | $10 per 1,000 calls | Search content tokens at the model's rates3 |
| OpenAI | Web search preview, non-reasoning models | $25 per 1,000 calls | Search content tokens free3 |
| OpenAI | File search | $2.50 per 1,000 calls; storage $0.10 per GB a day, 1 GB free | Retrieved tokens3 |
| OpenAI | Hosted Shell and Code Interpreter containers | $0.03 (1 GB), $0.12 (4 GB), $0.48 (16 GB), $1.92 (64 GB) per 20-minute session | Model tokens3 |
| Anthropic | Web search | $10 per 1,000 searches | Results as input tokens, this turn and later turns4 |
| Anthropic | Web fetch | No extra charge | Fetched content as tokens4 |
| Anthropic | Code execution | Free with web_search_20260209 or web_fetch_20260209 and later; otherwise 1,550 free hours a month, then $0.05 per container-hour | Model tokens4 |
| Grounding with Google Search (Gemini 3 and newer) | 5,000 free requests a month, then $14 per 1,000 | One request can run several billed queries5 | |
| DeepSeek | Search API, Fetch API | $0.75 per 1,000 successful requests each | Results the agent passes back as model tokens6 |
| AWS Bedrock | Web Search (Responses API on bedrock-mantle) | Charged per query; no rate shown on the pricing page read | Observations as input tokens78 |
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:
- Anthropic. Read
usage.server_tool_use.web_search_requestson each response11. - OpenAI. Count
web_search_calloutput items whose action issearch; OpenAI notes that search actions incur the tool call cost13. Container sessions are counted by time, not by call. - Gemini. Count grounding queries, not requests, because one request can trigger several billed queries5.
- 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.
- 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.
