跳转到主要内容

Responses Web 搜索

POST /v1/responses
截至 2026 年 3 月 23 日,Crazyrouter 生产环境已验证 gpt-5.4 通过 Responses API 使用:
  • tools: [{ "type": "web_search_preview" }]
  • 返回 output 类型顺序 web_search_callmessage
Claude 当前不支持 POST /v1/responses。如果你在接 Claude Web Search,请改用 POST /v1/chat/completions 或 Claude 原生接口。

最小请求

curl https://crazyrouter.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.4",
    "input": "Find one AI news item from March 2026.",
    "tools": [
      {
        "type": "web_search_preview"
      }
    ]
  }'
生产环境实际返回的关键形态:
{
  "output": [
    {
      "type": "web_search_call"
    },
    {
      "type": "message"
    }
  ]
}

当前判断标准

如果你要确认模型是否真的触发了联网搜索,当前最稳妥的检查项是:
  • output 中是否出现 web_search_call
  • 最终回答是否仍然以 message 形式返回
本页不再保留旧的过时示例,也不把未复测的搜索参数写成当前主文档。