Skip to main content
The Responses API supports web search integration, allowing models to access real-time information from the internet and provide responses with proper citations and annotations.
Deprecated Plugin ApproachThe 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.

Web Search Plugin

Enable web search using the plugins parameter:

Plugin Configuration

Configure web search behavior: See the Web Search plugin docs for full details on engine selection, domain filter compatibility, and pricing.

X Search (SpaceXAI only)

On SpaceXAI models (e.g. x-ai/grok-4.1-fast), web search sends only SpaceXAI’s web_search tool. Add an x_search object to the plugin to also search X/Twitter. An empty object enables it with no filters:
The same object is accepted as parameters.x_search on the openrouter:web_search server tool. The legacy top-level x_search_filter request field still enables X search for backward compatibility. X search is opt-in because SpaceXAI bills it per item returned starting September 21, 2026 at 12:00 PM PT (5per1,000postsfetchedand5 per 1,000 posts fetched and 10 per 1,000 user profiles fetched, replacing $5 per 1,000 tool calls).
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:

Online Model Variants

DeprecatedThe :online variant is deprecated. Use the openrouter:web_search server tool instead.
Some models have built-in web search capabilities using the :online variant:

Response with Annotations

Web search responses include citation annotations:

Annotation Types

Web search responses can include different annotation types:

URL Citation

Complex Search Queries

Handle multi-part search queries:

Web Search in Conversation

Include web search in multi-turn conversations:
Monitor web search progress with streaming:

Annotation Processing

Extract and process citation information:

Best Practices

  1. Limit results: Use appropriate max_results to balance quality and speed
  2. Handle annotations: Process citation annotations for proper attribution
  3. Query specificity: Make search queries specific for better results
  4. Error handling: Handle cases where web search might fail
  5. Rate limits: Be mindful of search rate limits

Next Steps