# Живі відповіді ChatGPT LLM

**API:** Data API

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

**Tags:** DataForSEO

Надсилає `user_prompt` моделі ChatGPT і синхронно повертає відповідь. `model_name` вибирає модель — див. `get_dataforseo_ai_chat_gpt_llm_responses_models`; незазначене в списку ім'я відхиляється одразу. `max_output_tokens`, `temperature` і `top_p` працюють так само, як у власному API постачальника, а `web_search` або `force_web_search` дозволяють моделі переглядати веб. Повертає `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. ⚠️ Це звичайний виклик LLM через постачальника даних, а не SEO-вимірювання. Якщо потрібно дізнатися, що ChatGPT каже користувачам про бренд, `post_dataforseo_ai_chat_gpt_llm_scraper_live` відтворює споживчий досвід.

### Довідкові дані про ціни

- Тарифікація: заявлена вартість відповіді.
- Орієнтовна вартість запиту: USD 0.0695.
- Довідковий множник для клієнта: 1.0. Не застосовуйте його повторно до вже розрахованої суми клієнта.

Довідкові метадані, а не котирування для облікового запису, гарантована ціна чи ліміт витрат. Кредити ресурсів — це не кредити Felo. Остаточні списання здійснюються за записами білінгу Felo.

## Related links

- [ендпоінті Models](<https://docs.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models/>)
- [тарифами](<https://platform.openai.com/docs/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>наприклад, якщо вказано <code>gpt-4.1</code>, як <code>model_name</code> автоматично буде задано <code>gpt-4.1-2025-04-14</code>;<br>список доступних LLM-моделей можна отримати окремим запитом до <code>https://api.dataforseo.com/v3/ai_optimization/chat_gpt/llm_responses/models</code>"
          },
          "max_output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "description": "<em>максимальна кількість токенів у відповіді AI</em><br>необов'язкове поле<br>мінімальне значення для reasoning-моделей (наприклад, якщо <code>reasoning</code> має значення <code>true</code> в ендпоінті Models): <code>1024</code>;<br>мінімальне значення для звичайних моделей: <code>16</code>;<br>максимальне значення: <code>4096</code>;<br>значення за замовчуванням: <code>2048</code><br><strong>Примітка:</strong> якщо <code>web_search</code> установлено в <code>true</code> або в запиті вказано reasoning-модель, кількість вихідних токенів може перевищити заданий ліміт <code>max_output_tokens</code>"
          },
          "temperature": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>ступінь випадковості відповіді AI</em><br>необов'язкове поле<br>вищі значення роблять вивід різноманітнішим; <br>нижчі значення роблять вивід більш зосередженим;<br>мінімальне значення: <code>0</code><br>максимальне значення: <code>2</code><br>значення за замовчуванням: <code>0.94</code><br><strong>Примітка:</strong> не підтримується в reasoning-моделях"
          },
          "top_p": {
            "type": [
              "number",
              "null"
            ],
            "description": "<em>різноманітність відповіді AI</em><br>необов'язкове поле <br>керує різноманітністю відповіді, обмежуючи вибір токенів;<br>мінімальне значення: <code>0</code><br>максимальне значення: <code>1</code> <br>значення за замовчуванням: <code>0.92</code><p><strong>Примітка:</strong> <code>top_p</code> не можна використовувати разом з <code>temperature</code> в одному запиті"
          },
          "web_search": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>увімкнути вебпошук</em><br>необов'язкове поле<br>коли ввімкнено, AI-модель може звертатися до актуальної інформації з інтернету та цитувати її;<br>значення за замовчуванням: <code>false</code>;<br><strong>Примітка:</strong> список моделей, які підтримують <code>web_search</code>, див. в ендпоінті Models;"
          },
          "force_web_search": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "<em>примусове використання вебпошуку AI-агентом</em><br>необов'язкове поле<br>щоб увімкнути цей параметр, також має бути ввімкнено <code>web_search</code>;<br>коли ввімкнено, AI-модель змушена звертатися до актуальної інформації з інтернету та цитувати її;<br>значення за замовчуванням: <code>false</code>;<br><strong>Примітка:</strong> навіть якщо параметр установлено в <code>true</code>, цитування веб-джерел у відповіді не гарантується <br><strong>Примітка #2:</strong> не підтримується в reasoning-моделях"
          },
          "web_search_country_iso_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>ISO-код країни місцезнаходження</em><br>необов'язкове поле<br>щоб увімкнути цей параметр, також має бути ввімкнено <code>web_search</code>;<br>коли ввімкнено, AI-модель шукатиме в інтернеті з указаної вами країни;<br><strong>Примітка:</strong> не підтримується в моделях <code>o3-mini</code>, <code>o1-pro</code>, <code>o1</code>"
          },
          "web_search_city": {
            "type": [
              "string",
              "null"
            ],
            "description": "<em>назва міста місцезнаходження</em><br>необов'язкове поле<br><strong>Примітка:</strong> не підтримується в моделях <code>o3-mini</code>, <code>o1-pro</code>, <code>o1</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>tag</code> ви знайдете в об'єкті <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,
            "model_name": "gpt-4.1-mini",
            "web_search": true,
            "web_search_country_iso_code": "FR",
            "web_search_city": "Paris",
            "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,
      "model_name": "gpt-4.1-mini",
      "web_search": true,
      "web_search_country_iso_code": "FR",
      "web_search_city": "Paris",
      "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_AiOptimizationChatGptLlmResponsesLiveResponseInfo"
    }
  ]
}
```

### 400 — Не вдалося обробити запит. Перевірте параметри запиту.

### 401 — Потрібен дійсний API-ключ Felo.

### 402 — Запит неможливо виконати: умови білінгу не виконано.

### 403 — Обліковий запис не має дозволу на цю операцію.

### 429 — Досягнуто ліміту запитів або витрат.

### 502 — Служба не змогла виконати запит.

### 503 — API або служба білінгу тимчасово недоступні.

### 504 — Час очікування обробки запиту вичерпано.

### default — Відповідь із помилкою; наскрізні відповіді апстріму можуть використовувати формати постачальника

**application/json**

Schema:

```json
{}
```

## Schema definitions

### Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveResponseInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveResponseInfo`

```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_AiOptimizationChatGptLlmResponsesLiveTaskInfo"
              }
            ]
          },
          "description": "<em>масив завдань</em>"
        }
      }
    }
  ]
}
```

### Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveResultInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveResultInfo`

```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"
      ],
      "description": "<em>кількість токенів міркування</em><br>загальна кількість токенів, використаних для генерації вмісту міркування"
    },
    "web_search": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "<em>указує, чи використовувався вебпошук</em>"
    },
    "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_BaseAiOptimizationLlmResponseElementItem"
          }
        ]
      },
      "description": "<em>масив елементів відповіді</em><br>містить структуровані дані відповіді AI"
    },
    "fan_out_queries": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "null"
        ]
      },
      "description": "<em>масив fan-out запитів</em><br>містить пов'язані пошукові запити, похідні від основного запиту, для повнішої відповіді"
    }
  }
}
```

### Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveTaskInfo

`#/components/schemas/Response36Afe1097B20_AiOptimizationChatGptLlmResponsesLiveTaskInfo`

```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_AiOptimizationChatGptLlmResponsesLiveResultInfo"
              }
            ]
          },
          "description": "<em>масив результатів</em>"
        }
      }
    }
  ]
}
```

### 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": "код стану завдання\nформується DataForSEO, може перебувати в діапазоні 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-запиті"
    }
  }
}
```
