跳转到主要内容
web_search Server Tool 使模型能够在推理过程中搜索网页。模型决定何时需要搜索,ARouter 执行搜索,结果会自动注入回模型的上下文中。
这是已废弃的 web 插件和 :online 模型后缀的推荐替代方案。

快速开始

{
  "model": "openai/gpt-5.4",
  "messages": [{"role": "user", "content": "What happened in AI research this week?"}],
  "tools": [{"type": "arouter", "arouter": {"id": "web_search"}}]
}

配置

参数类型默认值描述
idstring必须为 "web_search"
max_resultsinteger5返回的最大搜索结果数量
enginestring自动搜索引擎:"native""exa""parallel""firecrawl"
include_domainsstring[]将结果限制在这些域名(支持通配符)
exclude_domainsstring[]排除这些域名的结果(支持通配符)
max_total_resultsinteger限制一次请求中多次搜索的总结果数

引擎选择

引擎描述适用场景
(未设置)如果提供商支持则使用 native,否则使用 Exa通用
"native"提供商内置搜索(OpenAI、Anthropic、xAI)最佳引用质量
"exa"Exa 的神经网络+关键词混合搜索研究、小众话题
"parallel"Parallel 的搜索 API快速广泛查询
"firecrawl"Firecrawl 深度爬取(BYOK)完整页面内容

解析引用

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "According to recent research...",
      "annotations": [{
        "type": "url_citation",
        "url_citation": {
          "url": "https://arxiv.org/abs/2501.12345",
          "title": "Scaling Laws for LLMs",
          "content": "We study the relationship between...",
          "start_index": 32, "end_index": 96
        }
      }]
    }
  }]
}

定价

引擎费用
Exa每 1,000 条结果 $4.00
Parallel每 1,000 条结果 $4.00
Native(OpenAI、Anthropic、xAI)按提供商费率直通
FirecrawlBYOK——使用你的 Firecrawl API key

从 Web 插件迁移

之前(已废弃):
{"model": "openai/gpt-5.4:online", "messages": [...]}
之后(推荐):
{"model": "openai/gpt-5.4", "tools": [{"type": "arouter", "arouter": {"id": "web_search"}}], "messages": [...]}