Skip to main content
Ground chat completions with real-time web results using extra_body.web_search. This works with any model supported by the router. For OpenAI-compatible clients, web_search_options is also accepted as a top-level field, but it is only supported by a limited number of providers. We recommend extra_body.web_search for broadest compatibility.
{
  "model": "openai/gpt-4o",
  "messages": [{ "role": "user", "content": "What are the latest AI news?" }],
  "extra_body": {
    "web_search": { "engine": "exa", "max_results": 3, "max_steps": 1 }
  }
}
ParameterNotes
engine"exa" | "google" | omit. Default exa.
max_resultsResults per search call. Default 3.
max_stepsSearch/refine rounds. Default 1.

web_search_options (OpenAI-compatible)

Top-level field on the request—no extra_body. Forwarded to providers that implement native web search.
{
  "model": "openai/gpt-4o",
  "messages": [{ "role": "user", "content": "What are the latest AI news?" }],
  "web_search_options": {
    "search_context_size": "low"
  }
}
search_context_size: "low" | "medium" | "high".

Citations & streaming

Assistant messages may include OpenAI-style annotations (e.g. type: "url_citation" with url, title, content). With stream: true, annotations are delivered on the last SSE chunk, alongside finish_reason.