




























The OpenRouter API now supports a web search feature, available for all models. This enables developers to fetch and integrate web search results directly into their message streams. By appending :online to the model slug or activating the web plugin, you can include relevant, up-to-date information in your workflows.
web plugin directly in your API requests, or the :online shortcut for easier setup.The web search plugin uses Exa.ai to retrieve results. Your prompt is passed to Exa, which executes relevant searches and summarizes the results. The results are then merged into a prompt. This is customizable (see below) but by default is:
A web search was conducted on {todays_date}. Incorporate the following web search results into your response. IMPORTANT: Cite them using markdown links named using the domain of the source. Example: nytimes.com. [web search results are inserted here]
The plugin injects this as a system message before the user message in the request payload.
Append :online to any model slug to enable web search.
{
"model": "openai/gpt-4o:online"
}
This :online tag is simply shorthand for specifying the web plugin, which also works:
{
"model": "openai/gpt-4o",
"plugins": [{ "id": "web" }]
}
The web plugin has two customization options:
max_results (default: 5).Example:
{
"model": "openai/gpt-4o:online",
"plugins": [
{
"id": "web",
"max_results": 3,
"search_prompt": "Consider these web results when forming your response:"
}
]
}
For more information, check the documentation or try it directly with OpenRouter Chat by toggling the ‘web’ icon on the model selector.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。