# Perplexity Sonar Reasoning Pro

**API:** Data API

**Endpoint:** `POST /v1/beta/perplexity/sonar-reasoning-pro`

**Tags:** Perplexity API

Analyze a question requiring reasoning supported by web search and citations. model and messages are required; use model sonar-reasoning-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 is not a Felo credit charge.

### Pricing reference

- Metering: Reported response cost.
- Reference request estimate: USD 0.03499.
- Reference customer multiplier: 1.0. Do not apply it again to a settled customer amount.

Reference metadata only, not an account quote, a guaranteed price or a spending cap. Resource credits are not Felo credits. Final charges follow Felo billing records.

## Base URL

- `https://openapi.felo.ai`

## Authentication

- `FeloBearerAuth` (http bearer, bearer format Felo API Key)
- `FeloApiKey` (apiKey in header `X-API-Key`)

## Request body

Required: **yes**

### application/json

Schema:

```json
{
  "type": "object",
  "required": [
    "model",
    "messages"
  ],
  "properties": {
    "model": {
      "type": "string",
      "description": "The Sonar model to use.",
      "enum": [
        "sonar",
        "sonar-pro",
        "sonar-reasoning-pro",
        "sonar-deep-research"
      ]
    },
    "messages": {
      "type": "array",
      "description": "A list of messages comprising the conversation so far.",
      "items": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant"
            ],
            "description": "The role of the message author."
          },
          "content": {
            "type": "string",
            "description": "The content of the message."
          }
        }
      }
    },
    "max_tokens": {
      "type": "integer",
      "description": "The maximum number of tokens to generate in the response."
    },
    "temperature": {
      "type": "number",
      "description": "Sampling temperature between 0 and 2. Lower values make output more focused and deterministic.",
      "default": 0.2,
      "minimum": 0,
      "maximum": 2
    },
    "top_p": {
      "type": "number",
      "description": "Nucleus sampling parameter. The model considers tokens with top_p probability mass.",
      "default": 0.9,
      "minimum": 0,
      "maximum": 1
    },
    "top_k": {
      "type": "integer",
      "description": "The number of tokens to keep for top-k filtering.",
      "default": 0,
      "minimum": 0,
      "maximum": 2048
    },
    "stream": {
      "type": "boolean",
      "description": "Whether to stream the response using server-sent events.",
      "default": false
    },
    "search_context": {
      "type": "string",
      "description": "Controls how much search context to use. Affects per-request cost.",
      "enum": [
        "low",
        "medium",
        "high"
      ],
      "default": "low"
    },
    "frequency_penalty": {
      "type": "number",
      "description": "Penalizes new tokens based on their existing frequency in the text so far. Positive values decrease the likelihood of repeating the same line verbatim.",
      "default": 1,
      "minimum": 0,
      "maximum": 2
    },
    "presence_penalty": {
      "type": "number",
      "description": "Penalizes new tokens based on whether they appear in the text so far. Positive values increase the likelihood of talking about new topics.",
      "default": 0,
      "minimum": -2,
      "maximum": 2
    },
    "return_citations": {
      "type": "boolean",
      "description": "Whether to return citations and search results in the response.",
      "default": true
    },
    "search_recency_filter": {
      "type": "string",
      "description": "Filter search results by recency.",
      "enum": [
        "month",
        "week",
        "day",
        "hour"
      ]
    },
    "search_domain_filter": {
      "type": "array",
      "description": "Limit search to specific domains.",
      "items": {
        "type": "string"
      }
    }
  }
}
```

Example:

```json
{
  "model": "sonar-reasoning-pro",
  "messages": [
    {
      "role": "user",
      "content": "Explain when conditional HTTP requests save bandwidth, citing the standards."
    }
  ],
  "max_tokens": 2048,
  "stream": false
}
```

## Responses

### 200 — Successful response with AI answer and citations

Headers:
- `X-Request-Id` (string) — Request identifier to include when contacting Felo support.

**application/json**

Schema: `ResponseD5E2470Dd28B_ChatCompletionResponse` (`#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse`)

Example:

```json
{
  "id": "example-sonar-reasoning-pro-completion",
  "model": "sonar-reasoning-pro",
  "object": "chat.completion",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "A successful cache validation can avoid transferring an unchanged body. [1]"
      },
      "finish_reason": "stop"
    }
  ],
  "citations": [
    "https://www.rfc-editor.org/rfc/rfc9110.html"
  ],
  "search_results": [
    {
      "title": "HTTP Semantics",
      "url": "https://www.rfc-editor.org/rfc/rfc9110.html"
    }
  ],
  "usage": {
    "prompt_tokens": 30,
    "completion_tokens": 50,
    "total_tokens": 80
  }
}
```

### 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 — Error response; upstream passthrough responses may use provider formats

**application/json**

Schema:

```json
{}
```

## Schema definitions

### ResponseD5E2470Dd28B_ChatCompletionResponse

`#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse`

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the completion."
    },
    "model": {
      "type": "string",
      "description": "The model used for the completion."
    },
    "object": {
      "type": "string",
      "example": "chat.completion"
    },
    "created": {
      "type": "integer",
      "description": "Unix timestamp of when the completion was created."
    },
    "choices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "message": {
            "type": "object",
            "properties": {
              "role": {
                "type": "string"
              },
              "content": {
                "type": "string",
                "description": "The AI-generated answer, with inline citation references like [1][2]."
              }
            }
          },
          "finish_reason": {
            "type": "string",
            "enum": [
              "stop",
              "length"
            ]
          }
        }
      }
    },
    "citations": {
      "type": "array",
      "description": "List of source URLs referenced in the answer.",
      "items": {
        "type": "string"
      }
    },
    "search_results": {
      "type": "array",
      "description": "Detailed search results with titles, snippets, and URLs.",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "snippet": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      }
    },
    "usage": {
      "type": "object",
      "properties": {
        "prompt_tokens": {
          "type": "integer"
        },
        "completion_tokens": {
          "type": "integer"
        },
        "total_tokens": {
          "type": "integer"
        },
        "search_context_size": {
          "type": "string"
        }
      }
    }
  }
}
```
