Felo API PlatformFelo API Platform

データ API / Perplexity / Sonar Deep Research

Perplexity Sonar Deep Research

Generate a research report using multiple web searches and cited sources. model and messages are required; use model sonar-deep-research for this endpoint. This public contract covers non-streaming JSON responses with stream false. Research can take several minutes and may exceed gateway or client timeouts. Read choices[].message.content, citations and search_results for the report and its sources. usage is not a Felo credit charge.

パラメータ

パス・クエリ・ヘッダーのパラメータはありません。

リクエストボディ

  • modelstring必須

    指定できる値: sonar · sonar-pro · sonar-reasoning-pro · sonar-deep-research

    The Sonar model to use.

  • messagesobject[]必須

    A list of messages comprising the conversation so far.

  • rolestring必須

    指定できる値: system · user · assistant

    The role of the message author.

  • contentstring必須

    The content of the message.

  • max_tokensinteger任意

    The maximum number of tokens to generate in the response.

  • temperaturenumber任意

    Sampling temperature between 0 and 2. Lower values make output more focused and deterministic.

  • top_pnumber任意

    Nucleus sampling parameter. The model considers tokens with top_p probability mass.

  • top_kinteger任意

    The number of tokens to keep for top-k filtering.

  • streamboolean任意

    指定できる値: false

    Only non-streaming JSON responses are covered by this public contract. Set false.

  • search_contextstring任意

    指定できる値: low · medium · high

    Controls how much search context to use. Affects per-request cost.

  • frequency_penaltynumber任意

    Penalizes new tokens based on their existing frequency in the text so far. Positive values decrease the likelihood of repeating the same line verbatim.

  • presence_penaltynumber任意

    Penalizes new tokens based on whether they appear in the text so far. Positive values increase the likelihood of talking about new topics.

  • return_citationsboolean任意

    Whether to return citations and search results in the response.

  • search_recency_filterstring任意

    指定できる値: month · week · day · hour

    Filter search results by recency.

  • search_domain_filterstring[]任意

    Limit search to specific domains.

リクエスト例

curl -X POST "https://openapi.felo.ai/v1/beta/perplexity/sonar-deep-research" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "<string>",
  "messages": [
    {}
  ],
  "max_tokens": 0,
  "temperature": 0,
  "top_p": 0,
  "top_k": 0,
  "stream": false,
  "search_context": "<string>"
}'

レスポンス

レスポンス例

{
  "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
  }
}

レスポンスのフィールド

  • idstring任意

    Unique identifier for the completion.

  • modelstring任意

    The model used for the completion.

  • objectstring任意
  • createdinteger任意

    Unix timestamp of when the completion was created.

  • choicesobject[]任意
  • indexinteger任意
  • messageobject任意
  • rolestring任意
  • contentstring任意

    The AI-generated answer, with inline citation references like [1][2].

  • finish_reasonstring任意

    指定できる値: stop · length

  • citationsstring[]任意

    List of source URLs referenced in the answer.

  • search_resultsobject[]任意

    Detailed search results with titles, snippets, and URLs.

  • titlestring任意
  • urlstring任意
  • snippetstring任意
  • datestring任意
  • sourcestring任意
  • usageobject任意
  • prompt_tokensinteger任意
  • completion_tokensinteger任意
  • total_tokensinteger任意
  • search_context_sizestring任意