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 額度扣費。

定價參考

  • 計量方式:依回報的回應成本計量。
  • 參考請求預估:USD 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

需要協助嗎?