用途:通过 OpenAI 兼容的 /chat/completions 接口获取基于网络搜索的 AI 答案,适合聊天集成、事实问答与深度主题研究。
主要能力:两种模式。单次搜索(默认)速度快,一次搜索生成答案,流式时可开启 enable_citations 获得行内引用;研究模式(enable_research=true)进行多轮迭代搜索,输出进度事件与综合后的带引用答案。接口兼容 OpenAI SDK,只需将 base_url 设为 https://api.search.brave.com/res/v1,model 填 brave。
使用方式:端点 POST https://api.search.brave.com/res/v1/chat/completions,认证用 X-Subscription-Token 头或 Authorization: Bearer。messages 必须恰好包含 1 条 user 消息。单次搜索可 stream=false 阻塞返回,或 stream=true 流式;研究模式必须 stream=true。研究参数包括 research_maximum_number_of_iterations(默认 4,1-5)、research_maximum_number_of_seconds(默认 180,1-300)、research_maximum_number_of_queries(默认 20,1-50)等。
限制:enable_research=true 必须配合 stream=true,且与 enable_citations=true 不兼容;enable_citations=true 也要求 stream=true。研究模式不支持阻塞响应。建议单次搜索超时至少 30 秒,研究模式至少 300 秒。费用与套餐信息见官方订阅页面,资料未提供具体价格。