Felo API PlatformFelo API Platform
全部 Perplexity 端点
v0.2.0-beta
OpenAPI 3.1.0

Perplexity Sonar Deep Research

服务器:https://openapi.felo.ai
客户端库

Perplexity API

​

Generate answers and research reports with web citations.

Perplexity Sonar Deep Research

​

通过多次网络搜索和引用来源生成研究报告。model 和 messages 为必填;本端点请使用模型 sonar-deep-research。本公开契约涵盖 stream 为 false 的非流式 JSON 响应。研究可能需要数分钟,且可能超出网关或客户端超时。从 choices[].message.content、citations 和 search_results 读取报告及其来源。usage 并非 Felo 额度扣费。

计费参考

  • 计量方式:按上报的响应成本计量。
  • 参考请求估算:0.23932 美元。
  • 参考客户倍率:1.0。不得对已结算的客户金额再次应用。

仅供参考的元数据,不是账户报价、保证价格或消费上限。资源额度不同于 Felo 额度。最终扣费以 Felo 计费记录为准。

请求体
必填
application/json
  • messages
    类型: array object[]
    必填

    包含迄今对话的消息列表。

    • content
      类型: string
      必填

      消息内容。

    • role
      类型: string 枚举
      必填

      消息作者的角色。

      值
      • system
      • user
      • assistant
  • model
    类型: string 枚举
    必填

    要使用的 Sonar 模型。

    值
    • sonar
    • sonar-pro
    • sonar-reasoning-pro
    • sonar-deep-research
  • frequency_penalty
    类型: number
    最小值:  
    0
    最大值:  
    2

    根据新 token 在迄今文本中的出现频率对其进行惩罚。正值会降低逐字重复同一行的可能性。

  • max_tokens
    类型: integer

    响应中要生成的最大 token 数。

  • presence_penalty
    类型: number
    最小值:  
    -2
    最大值:  
    2

    根据新 token 是否已出现在迄今文本中对其进行惩罚。正值会提高谈论新话题的可能性。

  • return_citations
    类型: boolean

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

  • search_context
    类型: string 枚举

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

    值
    • low
    • medium
    • high
  • search_domain_filter
    类型: array string[]

    将搜索限制在特定域名。

  • search_recency_filter
    类型: string 枚举

    按新鲜度筛选搜索结果。

    值
    • month
    • week
    • day
    • hour
  • stream
    类型: boolean

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

  • temperature
    类型: number
    最小值:  
    0
    最大值:  
    2

    采样温度,介于 0 到 2 之间。值越低,输出越聚焦、越确定。

  • top_k
    类型: integer
    最小值:  
    0
    最大值:  
    2048

    top-k 过滤保留的 token 数。

  • top_p
    类型: number
    最小值:  
    0
    最大值:  
    1

    核采样参数。模型只考虑累计概率达到 top_p 的 token。

响应
  • 200
    类型: object · ResponseD5E2470Dd28B_ChatCompletionResponse

    成功响应,包含 AI 回答和引用

    • choices
      类型: array object[]
      • finish_reason
        类型: string 枚举
        值
        • stop
        • length
      • index
        类型: integer

        Integer numbers.

      • message
        类型: object
        • content
          类型: string

          AI 生成的回答,带 [1][2] 这类行内引用标记。

        • role
          类型: string
    • citations
      类型: array string[]

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

    • created
      类型: integer

      创建补全时的 Unix 时间戳。

    • id
      类型: string

      补全的唯一标识符。

    • model
      类型: string

      用于补全的模型。

    • object
      类型: string
    • search_results
      类型: array object[]

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

      • date
        类型: string
      • snippet
        类型: string
      • source
        类型: string
      • title
        类型: string
      • url
        类型: string
    • usage
      类型: object
      • completion_tokens
        类型: integer

        Integer numbers.

      • prompt_tokens
        类型: integer

        Integer numbers.

      • search_context_size
        类型: string
      • total_tokens
        类型: integer

        Integer numbers.

    application/json
  • 400

    无法处理该请求。请检查请求参数。

  • 401

    需要有效的 Felo API 密钥。

  • 402

    由于未满足计费要求,请求无法继续。

  • 403

    该账户无权执行此操作。

  • 429

    已达到请求或支出限额。

  • 502

    服务无法完成该请求。

  • 503

    API 或计费服务暂时不可用。

  • 504

    服务在处理请求时超时。

  • default

    错误响应;上游透传响应可能采用提供方格式

    application/json
Request Example for post/v1/beta/perplexity/sonar-deep-research
curl --request POST https://openapi.felo.ai/v1/beta/perplexity/sonar-deep-research \
  --header "Authorization: Bearer ${FELO_API_KEY:?Set FELO_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data '{"model": "sonar-deep-research", "messages": [{"role": "user", "content": "Research HTTP caching strategies for public APIs, with references to standards."}], "max_tokens": 4096, "stream": false}'
{
  "id": "example-sonar-deep-research-completion",
  "model": "sonar-deep-research",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Public API caching combines freshness controls and conditional requests. [1][2]"
      },
      "finish_reason": "stop"
    }
  ],
  "citations": [
    "https://www.rfc-editor.org/rfc/rfc9111.html",
    "https://www.rfc-editor.org/rfc/rfc9110.html"
  ],
  "search_results": [
    {
      "title": "HTTP Caching",
      "url": "https://www.rfc-editor.org/rfc/rfc9111.html"
    },
    {
      "title": "HTTP Semantics",
      "url": "https://www.rfc-editor.org/rfc/rfc9110.html"
    }
  ],
  "usage": {
    "prompt_tokens": 40,
    "completion_tokens": 80,
    "total_tokens": 120
  }
}
Perplexity Sonar Deep Research

需要帮助?