Web Search

Add web retrieval to Responses API runs for fresher, source-backed answers.

Coming Soon
Web search tool routing is not yet implemented in the gateway. Requests that include { "type": "web_search" } in the tools array will be forwarded to the upstream provider as-is. Only providers that natively support web search (e.g., OpenAI) will process this tool; others may ignore it or return an error.
POST/v1/responses
NameTypeRequiredDescription
tools
arrayRequiredInclude web search tool definition
type
stringRequiredweb_search
search_context_size
stringlow | medium | high
tool_choice
stringauto to let model decide when to search

Example Request

JSON
{
  "model": "openai/gpt-4o-mini",
  "input": "What are the most notable AI infra launches this week?",
  "tools": [
    {"type": "web_search", "search_context_size": "medium"}
  ],
  "tool_choice": "auto"
}
search-augmented-output.json
{
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        {
          "type": "output_text",
          "text": "This week saw launches in model serving and eval tooling...",
          "annotations": [
            {"type": "url_citation", "url": "https://example.com/news-1", "title": "Launch 1"},
            {"type": "url_citation", "url": "https://example.com/news-2", "title": "Launch 2"}
          ]
        }
      ]
    }
  ]
}
Trust but Verify
Web search improves recency but does not eliminate hallucinations. Validate cited claims before using them in production decisions.