Web search API output formats and token cost for local LLMs
One SearXNG search through our LB = 10 results, 556 tokens injected, ~0.9 s warm. Below: the real response, and the documented shape of every hosted search API.
Series — web search for local LLMs: Overview · Native Claude vs self-hosted · Search quality · Output formats & token cost · Next stage: Web scrapers for local LLMs
Token cost per search
Run locally on my fleet.
| Query | Results | Injected tok | Raw JSON tok | Warm | Cold |
|---|---|---|---|---|---|
q1 robertz.co | 10 | 530 | 1,057 | 1,163 ms | 3,643 ms |
q2 robertz.co authentication methods battle | 10 | 551 | 1,081 | 850 ms | 3,378 ms |
q3 robertz.co broker_parrot self-hosted job fleet | 10 | 587 | 1,454 | 669 ms | 5,044 ms |
| mean | 10 | 556 | 1,197 | 894 ms | 4,022 ms |
SearXNG through our LB — the real response
Query q1 robertz.co; the LB answers a web_search_20250305 tool with synthesised blocks. Pretty-printed, unicode unescaped, all 10 results shown.
{
"id": "msg_48238ff67e9b448c892617af",
"type": "message",
"role": "assistant",
"model": "fullclaudevllm",
"content": [
{
"type": "server_tool_use",
"id": "srvtoolu_70eca560776d4a4bb4886528",
"name": "web_search",
"input": {
"query": "robertz.co"
}
},
{
"type": "web_search_tool_result",
"tool_use_id": "srvtoolu_70eca560776d4a4bb4886528",
"content": [
{
"type": "web_search_result",
"title": "simulators — robertz.co — 22 interactive simulators you can run in the browser: digital logic and CPUs, networking and radio, databases, auth flows and algorithm complexity. No install, no sign-up.",
"url": "https://robertz.co/simulators/",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "www.Robertz.com - Welcome to RobertZ Web Site — In the United Kingdom, Robertz.com is ranked 18,301,672, with an estimated 4,536 monthly visitors a month. Click to view other data about this site.",
"url": "http://urlm.co.uk/www.robertz.com",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "Robert Zieliński — software engineer · robertz.co — Robert Zieliński — software engineer behind robertz.co, leometeo.com, and dobrapogoda24. Notes on infra, deploys, Python, and Ruby on Rails.",
"url": "https://robertz.co/",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "Roberts Co — Roberts Co is a boutique tier one construction company. We're here to build a better way.",
"url": "https://roberts.co/",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "www.Robertz.com - Welcome to RobertZ Web Site — In the United States, Robertz.com is ranked 37,782,615, with an estimated 10,206 monthly visitors a month. Click to view other data about this site.",
"url": "http://urlm.co/www.robertz.com",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "www.Robertzandco.com - Robertz & Co. — In België, Robertzandco.com heeft 530.064 in de rangschikking met een geschatte < 300 bezoekers per maand. Klik om andere gegevens over deze site te bekijken.",
"url": "http://urlmetrics.be/www.robertzandco.com",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "Link to instagram.com — The site owner hides the web page description.",
"url": "https://www.instagram.com/robertz.co/",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "Home - The Roberts Company — Safety, reliability, responsiveness, expertise and innovation. These are the drivers behind the products and services provided by...",
"url": "https://www.robertscompany.com/",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "robertz | robzlog — Hello and welcome. Who am I? Robert Zarywacz I'm a real person who lives in Ilfracombe in North Devon, England on the coast of the Bristol Channel.",
"url": "https://www.robzlog.co.uk/robertz",
"encrypted_content": "",
"page_age": null
},
{
"type": "web_search_result",
"title": "Robertz and Co – Stratégie – Organisation – Management – Marketing — Cabinet de Conseil en Stratégie, Organisation et Management. Robertz & Co accompagne les organisations dans la réalisation de leurs projets stratégiques afin d’améliorer leurs...",
"url": "https://robertzandco.com/",
"encrypted_content": "",
"page_age": null
}
]
}
],
"stop_reason": "end_turn",
"stop_sequence": null,
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"server_tool_use": {
"web_search_requests": 1
}
}
}
The text counted as injected (title + URL per hit, 530 tokens):
simulators — robertz.co — 22 interactive simulators you can run in the browser: digital logic and CPUs, networking and radio, databases, auth flows and algorithm complexity. No install, no sign-up.
https://robertz.co/simulators/
www.Robertz.com - Welcome to RobertZ Web Site — In the United Kingdom, Robertz.com is ranked 18,301,672, with an estimated 4,536 monthly visitors a month. Click to view other data about this site.
http://urlm.co.uk/www.robertz.com
Robert Zieliński — software engineer · robertz.co — Robert Zieliński — software engineer behind robertz.co, leometeo.com, and dobrapogoda24. Notes on infra, deploys, Python, and Ruby on Rails.
https://robertz.co/
… (14 more lines)
Documented formats — not run (no API key on the box)
Response skeletons from each vendor’s API reference. Placeholders only; nothing here was fetched.
| API | Output shape | Per-result content field | Billing |
|---|---|---|---|
| SearXNG via our LB (measured, above) | Anthropic blocks (server_tool_use + web_search_tool_result) | title + URL; encrypted_content empty, page_age null | $0 marginal · 556 tok / search |
Claude web_search_20250305 | Anthropic blocks + cited text | encrypted_content (opaque) | $10 / 1k searches + tokens |
Tavily /search | JSON | content, optional raw_content | not measured |
| Brave Web Search | JSON | description, optional extra_snippets | not measured |
Exa /search | JSON | text, highlights, summary | costDollars in response |
| Perplexity Sonar | OpenAI-style chat completion | snippet in search_results | not measured |
Claude web_search (native)
{
"role": "assistant",
"content": [
{ "type": "server_tool_use", "id": "<srvtoolu_id>", "name": "web_search",
"input": { "query": "<query>" } },
{ "type": "web_search_tool_result", "tool_use_id": "<srvtoolu_id>",
"content": [
{ "type": "web_search_result", "url": "<url>", "title": "<title>",
"encrypted_content": "<opaque>", "page_age": "<date>" }
] },
{ "type": "text", "text": "<answer>",
"citations": [
{ "type": "web_search_result_location", "url": "<url>", "title": "<title>",
"encrypted_index": "<opaque>", "cited_text": "<up to 150 chars>" }
] }
],
"usage": { "input_tokens": "<n>", "output_tokens": "<n>",
"server_tool_use": { "web_search_requests": "<n>" } }
}
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool
Tavily
{
"query": "<query>",
"answer": "<only with include_answer>",
"images": [],
"results": [
{ "title": "<title>", "url": "<url>", "content": "<snippet>", "score": "<float>",
"raw_content": "<only with include_raw_content>",
"published_date": "<only with include_published_date>",
"favicon": "<url>", "images": [], "id": "<id>" }
],
"auto_parameters": "<only with auto_parameters>",
"response_time": "<seconds>",
"usage": "<usage>",
"request_id": "<id>"
}
Source: docs.tavily.com/documentation/api-reference/endpoint/search
Brave Search API
{
"query": "<query object>",
"web": {
"results": [
{ "title": "<title>", "url": "<url>", "description": "<snippet>",
"extra_snippets": ["<only with extra_snippets=true>"] }
]
},
"locations": "<optional>",
"rich": "<optional>"
}
Source: api-dashboard.search.brave.com/app/documentation/web-search/responses — the page shows partial examples; more keys may exist.
Exa
{
"requestId": "<id>",
"results": [
{ "title": "<title>", "url": "<url>", "publishedDate": "<date>", "author": "<author>",
"id": "<id>", "image": "<url>", "favicon": "<url>",
"text": "<page text>", "highlights": ["<passage>"], "highlightScores": ["<float>"],
"summary": "<summary>", "subpages": [], "entities": [],
"extras": { "links": [], "imageLinks": [], "richImageLinks": [], "richLinks": [], "codeBlocks": [] } }
],
"costDollars": "<cost object>",
"searchTime": "<ms>"
}
Source: exa.ai/docs/reference/search
Perplexity Sonar
{
"id": "<id>",
"object": "<object>",
"created": "<unix>",
"model": "<sonar model>",
"choices": [
{ "message": { "role": "assistant", "content": "<answer with [n] markers>" },
"finish_reason": "<reason>" }
],
"citations": ["<url>"],
"search_results": [
{ "title": "<title>", "url": "<url>", "date": "<date>", "last_updated": "<date>",
"snippet": "<snippet>", "source": "<source>", "place_metadata": "<optional>" }
]
}
Source: docs.perplexity.ai/api-reference/chat-completions-post — the example elides some fields.