# لائیو Perplexity LLM Responses

**API:** Data API

**Endpoint:** `POST /v1/beta/dataforseo/ai_optimization/perplexity/llm_responses/live`

**Tags:** DataForSEO

`user_prompt` کو Perplexity ماڈل کو بھیجتا ہے اور اس کا جواب ہم وقت واپس کرتا ہے۔ `model_name` لازماً `get_dataforseo_ai_perplexity_llm_responses_models` سے ہونا چاہیے - `sonar`، `sonar-pro` اور `sonar-reasoning-pro`۔ `web_search_country_iso_code` تلاش کا دائرہ متعین کرتا ہے، جو باقی تین وینڈرز پیش نہیں کرتے۔ `model_name`، `input_tokens`، `output_tokens`، `reasoning_tokens`، `web_search`، `money_spent`، `datetime`، `items` اور `fan_out_queries` واپس کرتا ہے۔ یہ دیکھنے کے لیے جواب پر `money_spent` پڑھیں کہ کسی پرامپٹ کی واقعی کتنی لاگت آئی۔ DataForSEO کے لفافے میں لپٹا: ڈیٹا `tasks[0].result` میں، نتیجہ `tasks[0].status_code` میں - مسترد شدہ درخواست بھی HTTP 200 واپس کرتی ہے۔

### قیمت کا حوالہ

- میٹرنگ: رپورٹ شدہ جواب کی لاگت۔
- حوالہ جاتی درخواست کا تخمینہ: USD 0.0163۔
- حوالہ جاتی صارف ملٹی پلائر: 1.0۔ تصفیہ شدہ صارف رقم پر اسے دوبارہ لاگو نہیں کریں۔

صرف حوالہ جاتی میٹا ڈیٹا، نہ کہ اکاؤنٹ کا کوٹ، ضمانت شدہ قیمت یا اخراجات کی حد۔ ریسورس کریڈٹس Felo کریڈٹس نہیں ہیں۔ حتمی چارجز Felo کے بلنگ ریکارڈز کے مطابق ہوں گے۔

## Related links

- [قیمت](<https://docs.perplexity.ai/guides/pricing>)

## 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: **no**

### application/json

Schema:

```json
{
  "type": "array",
  "items": {
    "type": [
      "object",
      "null"
    ],
    "oneOf": [
      {
        "type": "object",
        "properties": {
          "user_prompt": {
            "type": "string",
            "description": "<em>AI ماڈل کے لیے پرامپٹ</em><br><strong>درکار فیلڈ</strong><br>وہ سوال یا کام جو آپ AI ماڈل کو بھیجنا چاہتے ہیں؛<br>آپ <code>user_prompt</code> فیلڈ میں <strong>زیادہ سے زیادہ 500 حروف</strong> متعین کر سکتے ہیں"
          },
          "model_name": {
            "type": "string",
            "description": "<em>AI ماڈل کا نام</em><br><strong>درکار فیلڈ</strong><br><code>model_name</code >اصل ماڈل نام اور ورژن نام پر مشتمل ہوتا ہے؛<br>اگر بنیادی ماڈل نام متعین کیا جائے تو ڈیفالٹ طور پر اس کا تازہ ترین ورژن سیٹ ہو جائے گا؛<br>آپ دستیاب LLM ماڈلز کی فہرست درج ذیل endpoint پر الگ درخواست بھیج کر حاصل کر سکتے ہیں: <code>https://api.dataforseo.com/v3/ai_optimization/perplexity/llm_responses/models</code>"
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>AI جواب میں ٹوکنز کی زیادہ سے زیادہ تعداد</em><br>اختیاری فیلڈ<br>کم از کم قدر: <code>1</code><br>زیادہ سے زیادہ قدر: <code>4096</code>؛<br>ڈیفالٹ قدر: <code>2048</code>؛<br><strong>نوٹ:</strong> اگر درخواست میں reasoning ماڈل متعین ہو تو آؤٹ پٹ ٹوکن کی تعداد متعین کردہ <code>max_output_tokens</code> حد سے تجاوز کر سکتی ہے"
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>AI جواب کی تصادفی پن</em><br>اختیاری فیلڈ<br>زیادہ قدریں آؤٹ پٹ کو زیادہ متنوع بناتی ہیں <br>کم قدریں آؤٹ پٹ کو زیادہ مرکوز بناتی ہیں<br>کم از کم قدر: <code>0</code><br>زیادہ سے زیادہ قدر: <code>1.9</code><br>ڈیفالٹ قدر: <code>0.77</code>"
          },
          "top_p": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>AI جواب کی تنوع</em><br>اختیاری فیلڈ <br>ٹوکن کے انتخاب کو محدود کر کے جواب کی تنوع کو کنٹرول کرتا ہے<br>کم از کم قدر: <code>0</code><br>زیادہ سے زیادہ قدر: <code>1</code> <br>ڈیفالٹ قدر: <code>0.9</code>"
          },
          "web_search_country_iso_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ویب تلاش لوکلائزیشن کے لیے ملکی کوڈ</em><br>اختیاری فیلڈ<br>لوکلائزڈ ویب تلاش کے نتائج حاصل کرنے کے لیے ملک کا ISO کوڈ متعین کریں<br><strong>نوٹ:</strong> صرف Perplexity Sonar ماڈلز کے لیے دستیاب<br>مثال: <code>US</code>"
          },
          "system_message": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>AI رویے کے لیے ہدایات</em><br>اختیاری فیلڈ<br>AI کا کردار، لہجہ یا مخصوص رویہ متعین کرتا ہے <br>آپ <code>system_message</code> فیلڈ میں <strong>زیادہ سے زیادہ 500 حروف</strong> متعین کر سکتے ہیں"
          },
          "message_chain": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": [
                "object",
                "null"
              ],
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "اس صارف کا کردار جس سے پیغام آتا ہے"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "پیغام کا متن"
                    }
                  }
                }
              ]
            },
            "description": "گفتگو کی تاریخ\nاختیاری فیلڈ\nپچھلی گفتگو کی باریوں کی نمائندگی کرنے والے پیغام آبجیکٹس کی صف؛\nہر آبجیکٹ میں شامل ہونا چاہیے:\nrole اسٹرنگ جس میں user یا ai کردار ہو؛\nmessage اسٹرنگ جس میں پیغام کا مواد ہو (زیادہ سے زیادہ 500 حروف)؛\nآپ صف میں زیادہ سے زیادہ 10 پیغام آبجیکٹس متعین کر سکتے ہیں؛\nنوٹ: Perplexity ماڈلز کے لیے پیغامات کا user اور AI کرداروں کے درمیان سختی سے باری باری آنا ضروری ہے (user → ai)؛\nمثال:\n\"message_chain\": [{\"role\":\"user\",\"message\":\"Hello, what’s up?\"},{\"role\":\"ai\",\"message\":\"Hello! I’m doing well, thank you. How can I assist you today?\"}]"
          },
          "tag": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>صارف کے متعین کردہ ٹاسک کا شناخت کنندہ</em><br>اختیاری فیلڈ<br><em>حروف کی حد 255 ہے</em><br>آپ اس پیرامیٹر سے ٹاسک کی شناخت کر سکتے ہیں اور اسے نتیجے سے ملا سکتے ہیں<br>آپ جواب کے <code>data</code> آبجیکٹ میں متعین کردہ <code>tag</code> قدر دیکھیں گے"
          }
        },
        "example": [
          {
            "system_message": "communicate as if we are in a business meeting",
            "message_chain": [
              {
                "role": "user",
                "message": "Hello, what’s up?"
              },
              {
                "role": "ai",
                "message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
              }
            ],
            "max_output_tokens": 200,
            "temperature": 0.3,
            "top_p": 0.5,
            "web_search_country_iso_code": "FR",
            "model_name": "sonar",
            "user_prompt": "provide information on how relevant the amusement park business is in France now"
          }
        ]
      }
    ]
  },
  "example": [
    {
      "system_message": "communicate as if we are in a business meeting",
      "message_chain": [
        {
          "role": "user",
          "message": "Hello, what’s up?"
        },
        {
          "role": "ai",
          "message": "Hello! I’m doing well, thank you. How can I assist you today? Are there any specific topics or projects you’d like to discuss in our meeting?"
        }
      ],
      "max_output_tokens": 200,
      "temperature": 0.3,
      "top_p": 0.5,
      "web_search_country_iso_code": "FR",
      "model_name": "sonar",
      "user_prompt": "provide information on how relevant the amusement park business is in France now"
    }
  ]
}
```

## Responses

### 200 — کامیاب آپریشن

Headers:
- `X-Request-Id` (string) — Felo سپورٹ سے رابطہ کرتے وقت شامل کرنے کے لیے درخواست کا شناخت کنندہ۔

**application/json**

Schema: object | null

```json
{
  "type": [
    "object",
    "null"
  ],
  "oneOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo"
    }
  ]
}
```

### 400 — درخواست پر کارروائی نہیں ہو سکی۔ درخواست کے پیرامیٹرز چیک کریں۔

### 401 — درست Felo API کلید درکار ہے۔

### 402 — درخواست آگے نہیں بڑھ سکتی کیونکہ بلنگ کی شرط پوری نہیں ہوئی۔

### 403 — اکاؤنٹ کو یہ آپریشن کرنے کی اجازت نہیں۔

### 429 — درخواست یا اخراجات کی حد پوری ہو گئی ہے۔

### 502 — سروس درخواست مکمل نہیں کر سکی۔

### 503 — API یا بلنگ سروس عارضی طور پر دستیاب نہیں۔

### 504 — درخواست پر کارروائی کے دوران سروس کا وقت ختم ہو گیا۔

### default — خرابی کا جواب؛ اپ اسٹریم پاس تھرو جوابات پرووائیڈر کی شکلیں استعمال کر سکتے ہیں

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResponseInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseInfo"
    },
    {
      "type": "object",
      "properties": {
        "tasks": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo"
              }
            ]
          },
          "description": "<em>ٹاسکس کی صف</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo`

```json
{
  "type": "object",
  "properties": {
    "model_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>استعمال شدہ AI ماڈل کا نام</em>"
    },
    "input_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>ان پٹ میں ٹوکنز کی تعداد</em><br>کارروائی شدہ ٹوکنز کی کل تعداد"
    },
    "output_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>آؤٹ پٹ میں ٹوکنز کی تعداد</em><br>AI جواب میں تیار کردہ ٹوکنز کی کل تعداد"
    },
    "reasoning_tokens": {
      "type": [
        "integer",
        "null"
      ]
    },
    "web_search": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>ظاہر کرتا ہے کہ ویب تلاش استعمال ہوئی یا نہیں</em><br><strong>نوٹ:</strong> Perplexity Sonar ماڈلز میں ویب تلاش بطور ڈیفالٹ فعال ہوتی ہے"
    },
    "money_spent": {
      "type": [
        "number",
        "null"
      ],
      "description": "<em>AI ٹوکنز کی لاگت، USD</em><br>وہ قیمت جو تھرڈ پارٹی AI ماڈل پرووائیڈر اپنی قیمت کے مطابق وصول کرتا ہے"
    },
    "datetime": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>وہ تاریخ اور وقت جب نتیجہ موصول ہوا</em><br>UTC فارمیٹ میں: “yyyy-mm-dd hh-mm-ss +00:00”<br>مثال:<br><code class=\"long-string\">2019-11-15 12:57:46 +00:00</code>"
    },
    "items": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem"
          }
        ]
      },
      "description": "<em>جوابی آئٹمز کی صف</em><br>ساختیافتہ AI جواب کا ڈیٹا رکھتا ہے"
    },
    "fan_out_queries": {
      "type": [
        "object",
        "null"
      ],
      "description": "<em>فین آؤٹ کوئریز کی صف</em><br>مرکزی کوئری سے اخذ کردہ متعلقہ تلاش کی کوئریز رکھتا ہے تاکہ زیادہ جامع جواب فراہم ہو"
    }
  }
}
```

### Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveTaskInfo`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo"
    },
    {
      "type": "object",
      "properties": {
        "result": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_AiOptimizationPerplexityLlmResponsesLiveResultInfo"
              }
            ]
          },
          "description": "<em>نتائج کی صف</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_AnnotationInfo

`#/components/schemas/Response36Afe1097B20_AnnotationInfo`

```json
{
  "type": "object",
  "properties": {
    "title": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>حوالہ دیے گئے ماخذ کا ڈومین نام یا عنوان</em>"
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>حوالہ دیے گئے ماخذ کا ری ڈائریکٹ URL</em><br>ایک Vertex AI ری ڈائریکٹ شامل ہے جو اصل ماخذ تک لے جاتا ہے"
    },
    "direct_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>حوالہ دیے گئے ماخذ کا براہ راست URL</em><br>وہ اصل ماخذ URL شامل ہے جس تک `url` فیلڈ میں موجود Vertex AI ری ڈائریکٹ لے جاتا ہے"
    },
    "start_index": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>اینوٹیشن انڈیکسنگ کا آغاز</em>"
    },
    "end_index": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>اینوٹیشن انڈیکسنگ کا اختتام</em>"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>reasoning chain سیکشن کا متن</em><br>reasoning chain سیکشن کا متن جو ماڈل کے سوچنے کے عمل کا خلاصہ پیش کرتا ہے"
    }
  }
}
```

### Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem

`#/components/schemas/Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "عنصر کی قسم"
    }
  },
  "additionalProperties": false,
  "discriminator": {
    "propertyName": "type",
    "mapping": {
      "reasoning": "#/components/schemas/Response36Afe1097B20_ReasoningAiOptimizationLlmResponseElementItem",
      "message": "#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseInfo`

```json
{
  "properties": {
    "version": {
      "type": [
        "string",
        "null"
      ],
      "description": "API کا موجودہ ورژن"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "عمومی اسٹیٹس کوڈ\nرسپانس کوڈز کی مکمل فہرست یہاں مل سکتی ہے"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "عمومی معلوماتی پیغام\nعمومی معلوماتی پیغامات کی مکمل فہرست یہاں مل سکتی ہے"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "کل عمل درآمد کا وقت، سیکنڈ"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ٹاسکس کی کل لاگت، USD",
      "format": "double"
    },
    "tasks_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "tasks صف میں ٹاسکس کی تعداد",
      "format": "int64"
    },
    "tasks_error": {
      "type": [
        "integer",
        "null"
      ],
      "description": "خرابی کے ساتھ واپس ہونے والے tasks صف میں ٹاسکس کی تعداد",
      "format": "int64"
    }
  }
}
```

### Response36Afe1097B20_BaseResponseTaskInfo

`#/components/schemas/Response36Afe1097B20_BaseResponseTaskInfo`

```json
{
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "ٹاسک شناخت کنندہ\nہمارے نظام میں UUID فارمیٹ کا منفرد ٹاسک شناخت کنندہ"
    },
    "status_code": {
      "type": [
        "integer",
        "null"
      ],
      "description": "ٹاسک کا اسٹیٹس کوڈ\nDataForSEO کی جانب سے تیار کردہ، درج ذیل حد میں ہو سکتا ہے: 10000-60000\nرسپانس کوڈز کی مکمل فہرست یہاں مل سکتی ہے"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "description": "ٹاسک کا معلوماتی پیغام\nعمومی معلوماتی پیغامات کی مکمل فہرست یہاں مل سکتی ہے"
    },
    "time": {
      "type": [
        "string",
        "null"
      ],
      "description": "عمل درآمد کا وقت، سیکنڈز"
    },
    "cost": {
      "type": [
        "number",
        "null"
      ],
      "description": "ٹاسکس کی کل لاگت، USD",
      "format": "double"
    },
    "result_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "result صف میں عناصر کی تعداد",
      "format": "int64"
    },
    "path": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "URL پاتھ"
    },
    "data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": [
          "object",
          "null"
        ]
      },
      "description": "وہی پیرامیٹرز رکھتا ہے جو آپ نے POST درخواست میں متعین کیے۔"
    }
  }
}
```

### Response36Afe1097B20_LlmMessageSectionInfo

`#/components/schemas/Response36Afe1097B20_LlmMessageSectionInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "عنصر کی قسم"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>reasoning chain سیکشن کا متن</em><br>reasoning chain سیکشن کا متن جو ماڈل کے سوچنے کے عمل کا خلاصہ پیش کرتا ہے"
    },
    "annotations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_AnnotationInfo"
          }
        ]
      },
      "description": "<em>جواب تیار کرنے کے لیے استعمال ہونے والے حوالہ جات کی صف</em><br><code>null</code> کے برابر ہوتا ہے اگر <code>web_search</code> پیرامیٹر <code>true</code> پر سیٹ نہ ہو<br><strong>نوٹ:</strong> <code>annotations</code> خالی بھی واپس ہو سکتا ہے جب <code>web_search</code> <code>true</code> ہو، کیونکہ AI ویب معلومات حاصل کرنے کی کوشش کرے گا مگر متعلقہ نتائج نہیں مل سکتے"
    }
  }
}
```

### Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem

`#/components/schemas/Response36Afe1097B20_MessageAiOptimizationLlmResponseElementItem`

```json
{
  "type": "object",
  "allOf": [
    {
      "$ref": "#/components/schemas/Response36Afe1097B20_BaseAiOptimizationLlmResponseElementItem"
    },
    {
      "type": "object",
      "properties": {
        "sections": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "object",
              "null"
            ],
            "oneOf": [
              {
                "$ref": "#/components/schemas/Response36Afe1097B20_LlmMessageSectionInfo"
              }
            ]
          },
          "description": "<em>reasoning chain سیکشنز</em><br>LLM کی جانب سے تیار کردہ reasoning chain سیکشنز پر مشتمل آبجیکٹس کی صف"
        }
      }
    }
  ]
}
```
