Try Web Search Server ToolFor improved quality results, try the
openrouter:web_search server tool. Server tools give the model control over when and how often to search, rather than always running once per request.web plugin, or by appending :online to the model slug:
:online to :free model variants like so:
Using web search will incur extra costs, even with free models. See the pricing section below for details.
:online is a shortcut for using the web plugin, and is exactly equivalent to:
For xAI models, the web search plugin enables both Web Search and X Search.
url_citation annotations, with Exa’s [...] markers separating excerpts that come from different parts of the same page.
Parsing web search results
Web search results for all models (including native-only models like Perplexity and OpenAI Online) are available in the API and standardized by OpenRouter to follow the same annotation schema in the OpenAI Chat Completion Message type:Customizing the Web Plugin
The maximum results allowed by the web plugin and the prompt used to attach them to your message stream can be customized:Domain Filtering
You can restrict which domains appear in web search results usinginclude_domains and exclude_domains:
*.substack.com) and path filtering (openai.com/blog).
Engine Compatibility
| Engine | include_domains | exclude_domains | Notes |
|---|---|---|---|
| Exa | Yes | Yes | Both can be used simultaneously |
| Parallel | Yes | Yes | Either can be used, they are mutually exclusive |
| Perplexity | Yes | Yes | Mutually exclusive (when both provided, include_domains wins) |
| Native | Varies | Varies | See provider notes below |
| Firecrawl | Yes | Yes | Mutually exclusive (cannot use both at once) |
Native Provider Behavior
When using native search, domain filter support depends on the provider:- Anthropic: Supports both
include_domainsandexclude_domains, but they are mutually exclusive — you cannot use both at once - Google: Domain filtering is not supported. With the default engine (auto), OpenRouter falls back to Exa when filters are set. With
"engine": "native", returns a 400 error - OpenAI: Supports
include_domainsonly;exclude_domainsis silently ignored - xAI: Supports both, but they are mutually exclusive with a maximum of 5 domains each
X Search Filters (xAI only)
When using xAI models with web search enabled, OpenRouter automatically adds thex_search tool
alongside web_search. You can pass filter
parameters to control X/Twitter search results
using the top-level x_search_filter parameter:
Filter Parameters
| Parameter | Type | Description |
|---|---|---|
allowed_x_handles | string[] | Only include posts from these handles (max 10) |
excluded_x_handles | string[] | Exclude posts from these handles (max 10) |
from_date | string | Start date for search range (ISO 8601, e.g. "2025-01-01") |
to_date | string | End date for search range (ISO 8601, e.g. "2025-12-31") |
enable_image_understanding | boolean | Enable analysis of images within posts |
enable_video_understanding | boolean | Enable analysis of videos within posts |
Engine Selection
The web search plugin supports the following options for theengine parameter:
native: Always uses the model provider’s built-in web search capabilitiesexa: Uses Exa’s search API for web resultsfirecrawl: Uses Firecrawl’s search APIparallel: Uses Parallel’s search API for web resultsperplexity: Uses the Perplexity Search API for ranked web resultsundefined(not specified): Uses native search if available for the provider, otherwise falls back to Exa
Default Behavior
When theengine parameter is not specified:
- Native search is used by default for OpenAI, Anthropic, Google, Perplexity, and xAI models that support it
- Exa search is used for all other models or when native search is not supported
"engine": "native", it will always attempt to use the provider’s native search, even if the model doesn’t support it (which may result in an error).
Forcing Engine Selection
You can explicitly specify which engine to use:Firecrawl
Firecrawl is a BYOK (bring your own key) search engine. To use it:- Go to your OpenRouter plugin settings and select Firecrawl as the web search engine
- Accept the Firecrawl Terms of Service — this automatically creates a Firecrawl account linked to your email
- Your account starts with 10,000 free credits (credits expire after 3 months)
Firecrawl supports
include_domains and exclude_domains, but they are mutually exclusive — you cannot use both in the same request.Parallel
Parallel is a search engine that supports domain filtering and uses OpenRouter credits at $0.005 per request. Includes up to 10 results in a request, then $0.001 per additional result.Engine-Specific Pricing
- Native search: Pricing is passed through directly from the provider (see provider-specific pricing info below)
- Exa search: Uses OpenRouter credits at $0.005 per request. Includes up to 10 results, then $0.001 per additional result
- Parallel search: Uses OpenRouter credits at $0.005 per request. Includes up to 10 results in a request, then $0.001 per additional result
- Perplexity search: Uses OpenRouter credits at $0.005 per request
- Firecrawl search: Uses your Firecrawl credits directly (2 credits per 10 results + 5 per result scraped with highlights). Refill at Firecrawl.dev
Pricing
Exa Search Pricing
When using Exa search (either explicitly via"engine": "exa" or as fallback), the web plugin uses your OpenRouter credits and charges $0.005 per request. This includes up to 10 results; additional results are charged at $0.001 each, in addition to the LLM usage for the search result prompt tokens.
Native Search Pricing (Provider Passthrough)
Some models have built-in web search. These models charge a fee based on the search context size, which determines how much search data is retrieved and processed for a query.Search Context Size Thresholds
Search context can be ‘low’, ‘medium’, or ‘high’ and determines how much search context is retrieved for a query:- Low: Minimal search context, suitable for basic queries
- Medium: Moderate search context, good for general queries
- High: Extensive search context, ideal for detailed research
Specifying Search Context Size
You can specify the search context size in your API request using theweb_search_options parameter:
Native Web Search PricingRefer to each provider’s documentation for their native web search pricing info:Native web search pricing only applies when using
"engine": "native" or when native search is used by default for supported models. When using "engine": "exa", the Exa search pricing applies instead.