web_search_20250305 on Anthropic, {type:"web_search"} on OpenAI Responses, {googleSearch:{}} on Google.
The opper:web_search tool documented here is the portable cross-provider shape. It gives you one tool entry, identical response artifacts, and no per-provider branching in your code.
Pick the canonical shape when you want a single tool entry that works regardless of which model the request lands on. Pick a native shape when you want the model’s provider-specific search behavior and are happy to author per-provider request bodies.
Quick start
Engine selection
Theengine field controls how Opper routes the search.
jina and exa are backend pins within Opper’s engine: like opper they always run the server-side search (never native), but force a specific provider. Availability depends on server-side configuration. Pinning a backend that isn’t configured returns a tool-call error.
Today, native web search is available on:
- Anthropic Claude on
/v3/compat/v1/messages(both directanthropic/and Vertexgcp/claude-*routes) - OpenAI on
/v3/compat/responsesfor Responses-API models (gpt-5*family, gpt-5-search-api, etc.) - Google Gemini on
/v3/compat/v1beta/models/{model}:generateContent
engine: "auto" will route to native on those combinations and to Opper’s engine for everything else (Mistral, DeepSeek, Alibaba Qwen, Groq, etc.).
Parameters
Citations and where they land
The response shape matches whatever endpoint you called, so your code reads citations from the same place regardless ofengine.
- Anthropic-shape:
content[]containsserver_tool_use,web_search_tool_result(URLs + snippets), andtextblocks whosecitations[](web_search_result_location) reference the sources. See server-side tools for the field-by-field shape. - OpenAI-shape (Responses):
output[]containsweb_search_callitems with the search queries and amessagewhosecontent[].output_text.annotations[]carryurl_citationentries. - OpenAI-shape (Chat Completions):
choices[0].message.annotations[]carry theurl_citationentries, mirroring the Responses shape. - Google-shape:
candidates[0].groundingMetadatacarrieswebSearchQueries,groundingChunks[].web(URI + title), andgroundingSupports.
On the native route (
engine: "auto" landing on a model with a native server tool) citations are anchored per statement: each one points at the exact span of prose the model grounded on, exactly as the provider emits them.On Opper’s engine route (engine: "opper", "jina", or "exa") citations are block-level: every source the search returned is attached to the answer text. You get the same fields in the same place, but without per-sentence character offsets, and the Google searchEntryPoint (provider-hosted “Search Suggestions” HTML) is not emitted.Cost and usage
Every response includes a tool-cost breakdown underusage.opper.cost.tools.web_search:
count is the number of searches the model actually ran, unit is the per-search cost, cost is the total. engine is also surfaced when the request routed through Opper’s engine.
Pricing
Opper’s engine is billed per search. Native searches (engine: "auto" landing on a model with a native tool, or engine: "native") are billed at the routed provider’s rate and passed through — the exact cost still shows up under usage.opper.cost.tools.web_search.
1 The underlying index for the native providers is as publicly reported, not officially confirmed by the provider. Native provider prices change independently of Opper; the linked pages are authoritative. More Opper engine backends will be added over time.
2 Data residency reflects where the search runs. Native searches execute on the provider’s own infrastructure — Opper doesn’t control their region, and only the Jina backend offers EU residency. This is separate from result localization: use the
country parameter (above) to bias results toward a geography, which does not change where the search runs.
In the trace
Each server-side search appears in the trace view as aserver_side_tool step nested under the turn that requested it, showing the query, the results it returned, and the per-search cost — so the search is never a black box.
Full example
The quick start keeps the tool entry minimal. This example sets every parameter on one request so you can see them in one place. Onlytype is required; everything else is optional and falls back to the engine or handler default.
CanonicalWebSearchTool schema) is the authoritative definition of every field, its type, and its default.
See also
- Provider server-side tools: native tool shapes per provider, routing rules, and the Vertex/Bedrock capability matrix.
- POST /v3/tools/web/search: call search as a standalone REST endpoint, with no model and no agentic loop.