Felo API PlatformFelo API Platform

데이터 API / Perplexity / Sonar Pro

Perplexity Sonar Pro

Generate an answer to a multi-part question using web search and citations. model and messages are required; use model sonar-pro for this endpoint. This public contract covers non-streaming JSON responses with stream false. Read choices[].message.content, citations and search_results for the answer and its sources. usage reports resource consumption, 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-pro" \
  -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-pro-completion",
  "model": "sonar-pro",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "no-cache requires validation before reuse; no-store prohibits storage. [1]"
      },
      "finish_reason": "stop"
    }
  ],
  "citations": [
    "https://www.rfc-editor.org/rfc/rfc9111.html"
  ],
  "search_results": [
    {
      "title": "HTTP Caching",
      "url": "https://www.rfc-editor.org/rfc/rfc9111.html"
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 40,
    "total_tokens": 65
  }
}

응답 필드

  • 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선택