Skip to main content
Web Search Injection allows the gateway to automatically execute a web search, parse the results, and prepend the factual context to the system prompt before forwarding the request to the LLM. This happens entirely server-side. Your application does not need to handle search APIs or format the results.

Basic Usage

To trigger a web search, simply include the "web_search": true flag in the JSON body of your request to the gateway.

Advanced Options

You can fine-tune the search behavior by passing additional sub-parameters in your JSON payload:

Example: Limiting search uses

Example: Native web search (OpenAI)

When using "native" mode, the gateway delegates the web search to the provider’s built-in tool (e.g. OpenAI’s web_search_preview tool). This is useful when you want the provider to handle search context directly in its reasoning.
Native web search is only supported by certain providers (OpenAI, Anthropic, Google). When using native mode, the provider’s own search tool handles query execution and result formatting. The web_search_level, web_search_lang, and web_search_country parameters are ignored in native mode since the provider controls search behavior.