# Perplexity Sonar Reasoning Pro

**API:** Data API

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

**Tags:** Perplexity API

ওয়েব সার্চ ও উদ্ধৃতি দ্বারা সমর্থিত যুক্তি প্রয়োজন এমন প্রশ্ন বিশ্লেষণ করুন। model ও messages আবশ্যক; এই এন্ডপয়েন্টের জন্য model sonar-reasoning-pro ব্যবহার করুন। এই পাবলিক কন্ট্রাক্ট stream false সহ non-streaming JSON রেসপন্স কভার করে। উত্তর ও তার সূত্রগুলোর জন্য choices[].message.content, citations ও search_results পড়ুন। usage Felo ক্রেডিট চার্জ নয়।

### মূল্য রেফারেন্স

- মিটারিং: রিপোর্ট করা রেসপন্স খরচ
- রেফারেন্স রিকোয়েস্ট অনুমান: USD 0.03499
- রেফারেন্স গ্রাহক গুণক: 1.0। নিষ্পত্তিকৃত গ্রাহক অঙ্কে এটি আবার প্রয়োগ করবেন না।

এটি কেবল রেফারেন্স মেটাডেটা; অ্যাকাউন্টের কোটেশন, নিশ্চিত মূল্য বা ব্যয়সীমা নয়। রিসোর্স ক্রেডিট Felo ক্রেডিট নয়। চূড়ান্ত চার্জ Felo-এর বিলিং রেকর্ড অনুযায়ী হয়।

## 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": "ব্যবহার করার জন্য Sonar মডেল।",
      "enum": [
        "sonar",
        "sonar-pro",
        "sonar-reasoning-pro",
        "sonar-deep-research"
      ]
    },
    "messages": {
      "type": "array",
      "description": "এখন পর্যন্ত কথোপকথন গঠনকারী message-এর তালিকা।",
      "items": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "system",
              "user",
              "assistant"
            ],
            "description": "message লেখকের ভূমিকা।"
          },
          "content": {
            "type": "string",
            "description": "message-এর কনটেন্ট।"
          }
        }
      }
    },
    "max_tokens": {
      "type": "integer",
      "description": "রেসপন্সে জেনারেট করার জন্য টোকেনের সর্বোচ্চ সংখ্যা।"
    },
    "temperature": {
      "type": "number",
      "description": "0 থেকে 2-এর মধ্যে স্যাম্পলিং তাপমাত্রা। কম মান আউটপুটকে আরও কেন্দ্রীভূত ও নির্ধারক করে।",
      "default": 0.2,
      "minimum": 0,
      "maximum": 2
    },
    "top_p": {
      "type": "number",
      "description": "নিউক্লিয়াস স্যাম্পলিং প্যারামিটার। মডেল top_p সম্ভাব্যতা ভরের টোকেন বিবেচনা করে।",
      "default": 0.9,
      "minimum": 0,
      "maximum": 1
    },
    "top_k": {
      "type": "integer",
      "description": "top-k ফিল্টারিংয়ের জন্য রাখার টোকেন সংখ্যা।",
      "default": 0,
      "minimum": 0,
      "maximum": 2048
    },
    "stream": {
      "type": "boolean",
      "description": "server-sent events ব্যবহার করে রেসপন্স স্ট্রিম করতে হবে কি না।",
      "default": false
    },
    "search_context": {
      "type": "string",
      "description": "কতটা সার্চ কনটেক্সট ব্যবহার হবে তা নিয়ন্ত্রণ করে। প্রতি-রিকোয়েস্ট খরচকে প্রভাবিত করে।",
      "enum": [
        "low",
        "medium",
        "high"
      ],
      "default": "low"
    },
    "frequency_penalty": {
      "type": "number",
      "description": "এখন পর্যন্ত টেক্সটে বিদ্যমান ফ্রিকোয়েন্সির ভিত্তিতে নতুন টোকেনে পেনাল্টি দেয়। ধনাত্মক মান একই লাইন হুবহু পুনরাবৃত্তি করার সম্ভাবনা কমায়।",
      "default": 1,
      "minimum": 0,
      "maximum": 2
    },
    "presence_penalty": {
      "type": "number",
      "description": "এখন পর্যন্ত টেক্সটে টোকেন আছে কি না তার ভিত্তিতে নতুন টোকেনে পেনাল্টি দেয়। ধনাত্মক মান নতুন বিষয় নিয়ে কথা বলার সম্ভাবনা বাড়ায়।",
      "default": 0,
      "minimum": -2,
      "maximum": 2
    },
    "return_citations": {
      "type": "boolean",
      "description": "রেসপন্সে উদ্ধৃতি ও সার্চ ফলাফল ফেরত দিতে হবে কি না।",
      "default": true
    },
    "search_recency_filter": {
      "type": "string",
      "description": "সার্চ ফলাফলকে সাম্প্রতিকতা অনুযায়ী ফিল্টার করুন।",
      "enum": [
        "month",
        "week",
        "day",
        "hour"
      ]
    },
    "search_domain_filter": {
      "type": "array",
      "description": "সার্চকে নির্দিষ্ট ডোমেনে সীমাবদ্ধ করুন।",
      "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 — AI উত্তর ও উদ্ধৃতি সহ সফল রেসপন্স

Headers:
- `X-Request-Id` (string) — Felo সাপোর্টে যোগাযোগের সময় অন্তর্ভুক্ত করার জন্য রিকোয়েস্ট আইডেন্টিফায়ার।

**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 — রিকোয়েস্ট প্রক্রিয়া করা যায়নি। রিকোয়েস্ট প্যারামিটার যাচাই করুন।

### 401 — একটি বৈধ Felo API key আবশ্যক।

### 402 — বিলিং শর্ত পূরণ না হওয়ায় রিকোয়েস্ট এগোতে পারছে না।

### 403 — অ্যাকাউন্টটিকে এই অপারেশন করার অনুমতি নেই।

### 429 — রিকোয়েস্ট বা ব্যয়ের সীমায় পৌঁছে গেছে।

### 502 — পরিষেবা রিকোয়েস্টটি সম্পন্ন করতে পারেনি।

### 503 — API বা বিলিং পরিষেবা সাময়িকভাবে অনুপলভ্য।

### 504 — রিকোয়েস্ট প্রক্রিয়াকরণের সময় পরিষেবার সময় শেষ হয়ে গেছে।

### default — ত্রুটি রেসপন্স; আপস্ট্রিম passthrough রেসপন্স প্রোভাইডারের ফর্ম্যাট ব্যবহার করতে পারে।

**application/json**

Schema:

```json
{}
```

## Schema definitions

### ResponseD5E2470Dd28B_ChatCompletionResponse

`#/components/schemas/ResponseD5E2470Dd28B_ChatCompletionResponse`

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "completion-এর অনন্য শনাক্তকারী"
    },
    "model": {
      "type": "string",
      "description": "completion-এর জন্য ব্যবহৃত মডেল"
    },
    "object": {
      "type": "string",
      "example": "chat.completion"
    },
    "created": {
      "type": "integer",
      "description": "completion কখন তৈরি হয়েছিল তার Unix টাইমস্ট্যাম্প"
    },
    "choices": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer"
          },
          "message": {
            "type": "object",
            "properties": {
              "role": {
                "type": "string"
              },
              "content": {
                "type": "string",
                "description": "AI-নির্মিত উত্তর, [1][2]-এর মতো ইনলাইন উদ্ধৃতি রেফারেন্সসহ"
              }
            }
          },
          "finish_reason": {
            "type": "string",
            "enum": [
              "stop",
              "length"
            ]
          }
        }
      }
    },
    "citations": {
      "type": "array",
      "description": "উত্তরে উল্লিখিত সোর্স URL-এর তালিকা",
      "items": {
        "type": "string"
      }
    },
    "search_results": {
      "type": "array",
      "description": "শিরোনাম, স্নিপেট ও URL সহ বিস্তারিত সার্চ ফলাফল",
      "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"
        }
      }
    }
  }
}
```
