Felo API PlatformFelo API Platform
v0.1.0-beta
OpenAPI 3.1.0

Perplexity Sonar Pro

サーバー:https://openapi.felo.ai
クライアントライブラリ

Perplexity API

​

Generate answers and research reports with web citations.

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.

リクエストボディ·ChatCompletionRequest
必須
application/json
  • messages
    型: array object[]
    必須

    A list of messages comprising the conversation so far.

    • content
      型: string
      必須

      The content of the message.

    • role
      型: string 列挙値
      必須

      The role of the message author.

      値
      • system
      • user
      • assistant
  • model
    型: string 列挙値
    必須

    The Sonar model to use.

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

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

  • max_tokens
    型: integer

    The maximum number of tokens to generate in the response.

  • presence_penalty
    型: number
    最小値:  
    -2
    最大値:  
    2

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

  • return_citations
    型: boolean

    Whether to return citations and search results in the response.

  • search_context
    型: string 列挙値

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

    値
    • low
    • medium
    • high
  • search_domain_filter
    型: array string[]

    Limit search to specific domains.

  • search_recency_filter
    型: string 列挙値

    Filter search results by recency.

    値
    • month
    • week
    • day
    • hour
  • stream
    型: boolean 列挙値
    定数:  
    false

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

    値
    • false
  • temperature
    型: number
    最小値:  
    0
    最大値:  
    2

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

  • top_k
    型: integer
    最小値:  
    0
    最大値:  
    2048

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

  • top_p
    型: number
    最小値:  
    0
    最大値:  
    1

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

レスポンス
  • 200
    型: object · ChatCompletionResponse

    Successful response with AI answer and citations

    • choices
      型: array object[]
      • finish_reason
        型: string 列挙値
        値
        • stop
        • length
      • index
        型: integer

        Integer numbers.

      • message
        型: object
        • content
          型: string

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

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

      List of source URLs referenced in the answer.

    • created
      型: integer

      Unix timestamp of when the completion was created.

    • id
      型: string

      Unique identifier for the completion.

    • model
      型: string

      The model used for the completion.

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

      Detailed search results with titles, snippets, and URLs.

      • 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

    The request could not be processed. Check the request parameters.

  • 401

    A valid Felo API key is required.

  • 402

    The request cannot proceed because a billing requirement is not met.

  • 403

    The account is not permitted to perform this operation.

  • 429

    A request or spending limit has been reached.

  • 502

    The service could not complete the request.

  • 503

    The API or billing service is temporarily unavailable.

  • 504

    The service timed out while processing the request.

  • default

    The operation failed. Keep the response request ID when contacting Felo support.

Request Example for post/v1/beta/perplexity/sonar-pro
curl --request POST https://openapi.felo.ai/v1/beta/perplexity/sonar-pro \
  --header "Authorization: Bearer ${FELO_API_KEY:?Set FELO_API_KEY}" \
  --header 'Content-Type: application/json' \
  --data '{"model": "sonar-pro", "messages": [{"role": "user", "content": "Compare Cache-Control no-cache and no-store, citing HTTP documentation."}], "max_tokens": 1024, "stream": false}'
{
  "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
  }
}
Perplexity Sonar Pro