Web Search
Real-time web search integration with the Responses API Beta
Real-time web search integration with the Responses API Beta
This API is in beta stage and may have breaking changes.
The Responses API Beta supports web search integration, allowing models to access real-time information from the internet and provide responses with proper citations and annotations.
The web search plugin (plugins: [{ id: "web" }]) shown below is deprecated. Use the openrouter:web_search server tool instead, which works with both the Chat Completions and Responses APIs via the tools array.
Enable web search using the plugins parameter:
Configure web search behavior:
See the Web Search plugin docs for full details on engine selection, domain filter compatibility, and pricing.
When using xAI models (e.g. x-ai/grok-4.1-fast),
you can pass x_search_filter as a top-level
request parameter to filter X/Twitter search
results:
allowed_x_handles and excluded_x_handles are
mutually exclusive. See the
Web Search plugin docs
for full details.
Use structured messages for more complex queries:
The :online variant is deprecated. Use the openrouter:web_search server tool instead.
Some models have built-in web search capabilities using the :online variant:
Web search responses include citation annotations:
Web search responses can include different annotation types:
Handle multi-part search queries:
Include web search in multi-turn conversations:
Monitor web search progress with streaming:
Extract and process citation information:
max_results to balance quality and speed