WebSearchPlugin - TypeScript SDK

WebSearchPlugin type definition

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

Example Usage

1import { WebSearchPlugin } from "@openrouter/sdk/models";
2
3let value: WebSearchPlugin = {
4 id: "web",
5};

Fields

FieldTypeRequiredDescriptionExample
enabledbooleanSet to false to disable the web-search plugin for this request. Defaults to true.
enginemodels.WebSearchEngineThe search engine to use for web search.exa
excludeDomainsstring[]A list of domains to exclude from web search results. Supports wildcards (e.g. “*.substack.com”) and path filtering (e.g. “openai.com/blog”).[
“example.com”,
“*.substack.com”,
“openai.com/blog”
]
id”web”✔️N/A
includeDomainsstring[]A list of domains to restrict web search results to. Supports wildcards (e.g. “*.substack.com”) and path filtering (e.g. “openai.com/blog”).[
“example.com”,
“*.substack.com”,
“openai.com/blog”
]
maxResultsnumberN/A
maxUsesnumberMaximum number of times the model can invoke web search in a single turn. Passed through to native providers that support it (e.g. Anthropic).
searchPromptstringN/A
userLocationmodels.UserLocationN/A{"city": "San Francisco","country": "US","region": "California","timezone": "America/Los_Angeles","type": "approximate"}