跳轉到主要內容
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": [...]}