WebSearchServerTool - TypeScript SDK

WebSearchServerTool type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

Web search tool configuration (2025-08-26 version)

Example Usage

1import { WebSearchServerTool } from "@openrouter/sdk/models";
2
3let value: WebSearchServerTool = {
4 type: "web_search_2025_08_26",
5};

Fields

FieldTypeRequiredDescriptionExample
enginemodels.WebSearchEngineEnumWhich search engine to use. “auto” (default) uses native if the provider supports it, otherwise Exa. “native” forces the provider’s built-in search. “exa” forces the Exa search API. “firecrawl” uses Firecrawl (requires BYOK). “parallel” uses the Parallel search API.auto
filtersmodels.WebSearchDomainFilterN/A{"allowed_domains": ["example.com"],"excluded_domains": ["spam.com"]}
maxResultsnumberMaximum number of search results to return per search call. Defaults to 5. Applies to Exa, Firecrawl, and Parallel engines; ignored with native provider search.5
searchContextSizemodels.SearchContextSizeEnumSize of the search context for web search toolsmedium
type”web_search_2025_08_26”✔️N/A
userLocationmodels.WebSearchUserLocationUser location information for web search{"city": "San Francisco","country": "USA","region": "California","timezone": "America/Los_Angeles","type": "approximate"}