Back to changelog

Web Search on Every Chat Model

The web_search tool now works on every chat model. Where the provider has no native search, LLM Gateway gives the model a search function and runs the queries it writes, so it can search, read, search again and cite its sources. /v1/models shows which providers search natively.

A glowing magnifying glass over a globe on a circuit board chip, surrounded by chat bubbles, document cards and link icons on small pedestals

Web search used to depend on the provider. GPT and Claude could search, and an open-weight model on a fast inference provider could not, so adding search meant picking a different model. Gateway-run web search removes that trade-off: the web_search tool now works on every chat model.

How It Works

The request does not change:

1curl https://api.llmgateway.io/v1/chat/completions \2  -H "Authorization: Bearer $LLM_GATEWAY_API_KEY" \3  -H "Content-Type: application/json" \4  -d '{5    "model": "glm-5.4",6    "messages": [{ "role": "user", "content": "What changed in the EU AI Act this month?" }],7    "tools": [{ "type": "web_search" }]8  }'

When the serving provider searches natively, the search runs there, as before. When it does not, LLM Gateway gives the model a web_search function and runs the searches it asks for. The model decides whether the turn needs a search, writes its own queries, reads the results, can search again, and then answers. Sources arrive as url_citation annotations in the same format as native search.

On /v1/responses, on models without tool calling, and in a few other cases, the gateway runs one search before the model answers instead: a small model writes up to three queries from the latest turns, and the results are added to your latest user message.

  • max_uses caps searches per request (default 5), and search_context_size sets results per search: low 3, medium 5, high 10.
  • Each model call appears in your activity log with the request ID plus -ws0, -ws1, and so on. The response's usage covers all of them.
  • If an offered search fails, the request continues without results and no search is billed. If a required search (tool_choice: {"type": "web_search"}) cannot run, the request fails with 503 and web_search_unavailable instead of answering without results.
  • A few providers only search when the request requires it. web_search_forced_only below marks them; on those, set tool_choice to require a search, or let routing pick another provider.

Pick the Search Engine

Owners choose the engine under Settings → Preferences → Web Search. It applies only when the provider has no native search.

Engine Price per search
Perplexity Search (default) $0.005
Exa $0.007

The engine receives the search queries, so your organization's or API key's compliance policy applies to it like to a provider. When the policy rejects the engine, no search runs.

Native Search Flags in /v1/models

Each entry in a model's providers array now reports how search works there:

Field true when
web_search The web_search tool works on that provider
web_search_native The provider runs the search itself
web_search_forced_only Native search runs only when the request requires a search

Web search docs → | Models with native search →