web_search Server Tool enables models to search the web during inference. The model decides when a search is needed, ARouter performs it, and the results are injected back into the model’s context automatically.
This is the recommended replacement for the deprecated
web plugin and :online model suffix. See Migration Guide below.Quick Start
- TypeScript
- Python
- cURL
Configuration
Pass configuration options inside thearouter object:
| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | Must be "web_search" |
max_results | integer | 5 | Maximum number of search results to return |
engine | string | auto | Search engine: "native", "exa", "parallel", or "firecrawl" |
include_domains | string[] | — | Restrict results to these domains (supports wildcards) |
exclude_domains | string[] | — | Exclude results from these domains (supports wildcards) |
max_total_results | integer | — | Cap total results across multiple searches in one request |
Engine Selection
| Engine | Description | Best For |
|---|---|---|
| (unset) | Use native if provider supports it, else Exa | General use |
"native" | Provider’s built-in search (OpenAI, Anthropic, xAI) | Best citation quality |
"exa" | Exa’s neural+keyword hybrid search | Research, niche topics |
"parallel" | Parallel’s search API | Fast broad queries |
"firecrawl" | Firecrawl deep crawl (BYOK) | Full page content |
Engine Compatibility
| Engine | include_domains | exclude_domains |
|---|---|---|
| Exa | Yes | Yes |
| Parallel | Yes | Yes (mutually exclusive with include) |
| Native (Anthropic) | Yes | Yes (mutually exclusive) |
| Native (OpenAI) | Yes | Ignored |
| Native (xAI) | Yes | Yes (mutually exclusive, max 5 each) |
Domain Filtering
Restrict or exclude domains with optional wildcards:Parsing Citations
Web search results are returned inannotations on the assistant message:
Usage Tracking
Each web search invocation is tracked:Pricing
| Engine | Cost |
|---|---|
| Exa | $4.00 per 1,000 results |
| Parallel | $4.00 per 1,000 results |
| Native (OpenAI, Anthropic, xAI) | Pass-through at provider rate |
| Firecrawl | BYOK — your Firecrawl API key |
max_results: 5, an Exa search costs $0.02 per invocation. Search costs are charged in addition to normal LLM token costs.
Migrating from Web Plugin
If you previously used theweb plugin or :online suffix, migration is straightforward:
Before (deprecated):
Next Steps
- Datetime Tool — Inject current time into model context
- Server Tools Overview — All available server tools
- Web Search Plugin (Deprecated) — Legacy plugin documentation