Skip to main content
POST
Sonar Deep Research — 详尽研究与综合报告
委托它写一份报告:这个端点会跑很多次检索,产出一篇长的、带引用的文档。传 model(必填,sonar-deep-research)和 messages;返回 choices[0].message.contentcitationssearch_results[]usage,其中 usage 还会报告 num_search_queriesreasoning_tokens。⚠️ 要为等待留出预算:一个两句话的问题实测耗时 192 秒、返回 86 KB、触发了 10 次上游检索 —— 比 post_perplexity_sonar 慢约 60 倍、大约 10 倍,而计费同样是每次 $0.012。很多客户端在它返回之前就超时了,所以只在「报告本身就是交付物」时调用,且绝不要放进循环。凡是能一口气读完的内容,另外三个 Perplexity 端点几秒就能给。

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
model
enum<string>
必填

要使用的 Sonar 模型。

可用选项:
sonar,
sonar-pro,
sonar-reasoning-pro,
sonar-deep-research
messages
object[]
必填

由截至目前的对话内容组成的消息列表。

max_tokens
integer

响应中要生成的最大词元数。

temperature
number
默认值:0.2

介于 0 和 2 之间的采样温度。较低的值会使输出更集中且更具确定性。

必填范围: 0 <= x <= 2
top_p
number
默认值:0.9

核采样参数。模型会考虑累计概率质量达到 top_p 的词元。

必填范围: 0 <= x <= 1
top_k
integer
默认值:0

用于 top-k 筛选的保留词元数。

必填范围: 0 <= x <= 2048
stream
boolean
默认值:false

是否使用服务器发送事件以流式方式返回响应。

search_context
enum<string>
默认值:low

控制使用的搜索上下文量。会影响单次请求的成本。

可用选项:
low,
medium,
high
frequency_penalty
number
默认值:1

根据新词元目前在文本中的出现频率对其施加惩罚。正值会降低逐字重复同一行的可能性。

必填范围: 0 <= x <= 2
presence_penalty
number
默认值:0

根据新词元此前是否已出现在文本中对其施加惩罚。正值会提高谈论新主题的可能性。

必填范围: -2 <= x <= 2
return_citations
boolean
默认值:true

是否在响应中返回引用和搜索结果。

search_recency_filter
enum<string>

按时效性筛选搜索结果。

可用选项:
month,
week,
day,
hour
search_domain_filter
string[]

将搜索限制在特定域名。

响应

200 - application/json

包含 AI 答案和引用的成功响应

id
string

补全结果的唯一标识符。

model
string

用于生成补全内容的模型。

object
string
示例:

"chat.completion"

created
integer

补全创建时间的 Unix 时间戳。

choices
object[]
citations
string[]

答案中引用的来源 URL 列表。

search_results
object[]

包含标题、摘要和 URL 的详细搜索结果。

usage
object