Web Search

Use model-native search tools only when the selected protocol and model support them.

Overview

Web search lets a model look up fresh information and cite sources instead of relying only on its training data. OneRouter forwards search-enabled requests to the upstream model, but availability, citations, latency, and cost all depend on that model. The exact request shape differs by protocol.

Protocol patterns

ParameterTypeRequiredDescription
web_search_optionsChatoptionalAdd to a Chat Completions request to enable native search on supporting models.
tools: web_searchResponsesoptionalAdd a web-search tool to the Responses `tools` array.
web_search toolClaudeoptionalClaude exposes web search as a tool the model can call.
googleSearch groundingGeminioptionalGemini grounds answers with the Google Search tool.

Example

curl https://onerouter.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-5.2",
    "messages": [{"role": "user", "content": "What changed in the latest TypeScript release?"}],
    "web_search_options": {}
  }'

Citations & cost

Search-capable models usually return source URLs or citation metadata alongside the answer — surface these to users for trust. Search often adds latency and may carry a per-call or per-result charge, so enable it per request rather than globally.

Model-dependent features

OneRouter keeps protocol compatibility and forwards model-specific parameters where supported. Features such as tool calling, structured output, reasoning, prompt caching, web search, image input, audio input, video generation, and provider-specific options depend on the selected model and upstream provider. Check the model detail page before relying on a feature in production.