# लाइव Perplexity LLM Responses

**API:** Data API

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

**Tags:** DataForSEO

किसी Perplexity मॉडल को `user_prompt` भेजता है और उसका उत्तर सिंक्रोनस रूप से लौटाता है। `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` लौटाता है। यह देखने के लिए कि एक प्रॉम्प्ट पर वास्तव में कितना खर्च हुआ, response में `money_spent` पढ़ें। DataForSEO के envelope में लिपटा: डेटा `tasks[0].result` में, परिणाम `tasks[0].status_code` में — अस्वीकृत request भी HTTP 200 ही लौटाता है।

### मूल्य संदर्भ

- मीटरिंग: रिपोर्ट किया गया response लागत।
- संदर्भ request अनुमान: USD 0.0163
- संदर्भ ग्राहक गुणक: 1.0. अंतिम रूप से निपटाई गई ग्राहक राशि पर इसे दोबारा लागू न करें।

केवल संदर्भ मेटाडेटा, खाते का कोटेशन, गारंटीशुदा मूल्य या खर्च सीमा नहीं। Resource credits, Felo क्रेडिट नहीं हैं। अंतिम शुल्क Felo बिलिंग रिकॉर्ड के अनुसार लगते हैं।

## Related links

- [Pricing](<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 response की विविधता</em><br>वैकल्पिक फ़ील्ड <br>टोकन चयन सीमित करके response की विविधता नियंत्रित करता है<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 आता है"
                    },
                    "message": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "message टेक्स्ट"
                    }
                  }
                }
              ]
            },
            "description": "बातचीत का इतिहास\nवैकल्पिक फ़ील्ड\nपिछले बातचीत टर्न को दर्शाने वाले message ऑब्जेक्ट का ऐरे;\nहर ऑब्जेक्ट में होना चाहिए:\nrole — user या ai भूमिका वाला स्ट्रिंग;\nmessage — message सामग्री वाला स्ट्रिंग (अधिकतम 500 अक्षर);\nऐरे में अधिकतम 10 message ऑब्जेक्ट निर्दिष्ट कर सकते हैं;\nनोट: Perplexity मॉडल के लिए message को 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>tag</code> मान response के <code>data</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 सहायता से संपर्क करते समय शामिल करने के लिए request पहचानकर्ता।

**application/json**

Schema: object | null

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

### 400 — request संसाधित नहीं किया जा सका। request पैरामीटर जाँचें।

### 401 — एक वैध Felo API key आवश्यक है।

### 402 — request आगे नहीं बढ़ सकता क्योंकि बिलिंग आवश्यकता पूरी नहीं हुई है।

### 403 — खाते को यह ऑपरेशन करने की अनुमति नहीं है।

### 429 — request या खर्च की सीमा तक पहुँच गए हैं।

### 502 — सेवा request पूरा नहीं कर सकी।

### 503 — API या बिलिंग सेवा अस्थायी रूप से उपलब्ध नहीं है।

### 504 — request संसाधित करते समय सेवा का समय समाप्त हो गया।

### default — त्रुटि response; upstream passthrough response प्रोवाइडर फ़ॉर्मेट का उपयोग कर सकते हैं।

**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>input में टोकन की संख्या</em><br>प्रोसेस किए गए टोकन की कुल संख्या"
    },
    "output_tokens": {
      "type": [
        "integer",
        "null"
      ],
      "description": "<em>output में टोकन की संख्या</em><br>AI response में जनरेट किए गए टोकन की कुल संख्या"
    },
    "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 मॉडल प्रदाता द्वारा अपनी Pricing के अनुसार ली जाने वाली कीमत"
    },
    "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>response आइटम का ऐरे</em><br>संरचित AI response डेटा शामिल है"
    },
    "fan_out_queries": {
      "type": [
        "object",
        "null"
      ],
      "description": "<em>fan-out क्वेरी का ऐरे</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>रीज़निंग चेन अनुभाग का टेक्स्ट</em><br>रीज़निंग चेन अनुभाग का टेक्स्ट जो मॉडल की सोच प्रक्रिया का सारांश देता है"
    }
  }
}
```

### 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": "सामान्य स्टेटस कोड\nresponse कोड की पूरी सूची यहाँ देखी जा सकती है"
    },
    "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\nresponse कोड की पूरी सूची यहाँ देखी जा सकती है"
    },
    "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 request में निर्दिष्ट किए थे"
    }
  }
}
```

### Response36Afe1097B20_LlmMessageSectionInfo

`#/components/schemas/Response36Afe1097B20_LlmMessageSectionInfo`

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": [
        "string",
        "null"
      ],
      "description": "एलिमेंट का प्रकार"
    },
    "text": {
      "type": [
        "string",
        "null"
      ],
      "description": "<em>रीज़निंग चेन अनुभाग का टेक्स्ट</em><br>रीज़निंग चेन अनुभाग का टेक्स्ट जो मॉडल की सोच प्रक्रिया का सारांश देता है"
    },
    "annotations": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "object",
          "null"
        ],
        "oneOf": [
          {
            "$ref": "#/components/schemas/Response36Afe1097B20_AnnotationInfo"
          }
        ]
      },
      "description": "<em>response उत्पन्न करने के लिए उपयोग किए गए संदर्भों का ऐरे</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>रीज़निंग चेन अनुभाग</em><br>LLM द्वारा उत्पन्न रीज़निंग चेन अनुभागों वाले ऑब्जेक्ट का ऐरे"
        }
      }
    }
  ]
}
```
