Docs · Routes and pricing
Web search: which models search and what a search costs
Claude, GPT-6 and Grok 4.7 can search the web. Each search costs the provider’s own fee, $0.01 or $0.005, on top of the tokens.
Since November 17, 2026, a model that searches the web during a request is charged a fee per search, the same fee its provider charges. The pages it reads come back as input tokens and are billed at the model's input price, like any other prompt.
Which models search
| Models | How to ask for a search | Fee per search |
|---|---|---|
claude-fable-5-2, claude-sonnet-5-5, claude-opus-5-5 |
On /v1/messages, add Anthropic's web search server tool: {"type": "web_search_20250305", "name": "web_search"} in tools |
$0.01 |
gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra |
On /v1/responses, add {"type": "web_search"} in tools; on /v1/chat/completions, send web_search_options and TopxAI forwards the request as Responses |
$0.01 |
grok-4.7 |
The same as GPT-6: the web_search tool on Responses, or web_search_options on Chat Completions |
$0.005 |
These are the providers' list prices: Anthropic and OpenAI charge $10 per 1,000 searches, xAI $5. The model pages show each model's fee per 1,000 searches.
The GLM, Kimi and DeepSeek models do not search: a request to them that asks for a search is answered without one and without a search fee, and the response carries the header X-TopxAI-Web-Search: unavailable. Jev is called on /v1/systemone, which takes no tools, so it cannot search. On Grok, the search_context_size and user_location options of the tool are dropped before forwarding, because xAI rejects them.
How searches are counted
The relay counts the searches the provider reports in its answer: usage.server_tool_use.web_search_requests on Claude, the web_search_call items on Responses. A Chat Completions answer reports the count in usage.server_tool_use.web_search_requests as well. On Claude the relay also counts the search result blocks in the answer, because some answers arrive without server_tool_use; a result block that comes without its results is counted only when the answer cites results or none of its searches failed, and never more often than the answer called a search or the request's max_uses allows. An answer that ends with an error pays no search fee. A model decides for itself how many times to search, so one request can contain several searches. Ask for fewer in the prompt, or leave the tool out, when you do not want searches.
A request whose answer is not charged (it failed before any output) is not charged for its searches either. A request served by a backup line pays the same search fee.
Where you see the charge
The usage log row of a request with searches lists them in Billing Details: the number of searches, the fee per search and the amount, next to the token lanes. The total in Wallet charged includes them.
Example
curl https://api.topxai.xyz/v1/messages \
-H "x-api-key: $TOPXAI_API_KEY" \
-H "content-type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"tools": [{"type": "web_search_20250305", "name": "web_search", "max_uses": 2}],
"messages": [{"role": "user", "content": "What changed in the latest Python release?"}]
}'
max_uses caps the searches Claude may run for this request; with two searches the request costs $0.02 plus its tokens.
Models: claude-fable-5-2, claude-sonnet-5-5, claude-opus-5-5, gpt-6.2-astra, gpt-6.2-sol, gpt-6.1-terra, grok-4.7 · Models & pricing
Related
- How requests are billed
- Reading your usage log
- API reference: every endpoint, with an OpenAPI specification
- Claude Fable 5.2 API pricing
- Claude Sonnet 5.5 API pricing
- Claude Opus 5.5 API pricing
- GPT-6.2 Astra API pricing
- GPT-6.2 Sol API pricing
- GPT-6.1 Terra API pricing
- Grok 4.7 API pricing
Previous: Reading your usage log · Next: Prompt caching: the automatic Claude cache and how to turn it off
Other languages: 简体中文