Создать ответ (OpenAI Responses API)
post/v1/responses
Создаёт ответ модели через OpenAI Responses API. Поддерживаются многоходовые диалоги, вызов инструментов и рассуждения.
Аутентификация
Передавайте ключ API OLETOKEN как Bearer-токен. Ключи создаются на странице «Ключи API» в консоли.
Authorization: Bearer $OLETOKEN_API_KEYТело запроса
Content-Type:application/json
| Поле | Тип | Обязательный | Описание |
|---|---|---|---|
| model | string | — | |
| input | string | object[] | — | Входные данные: строка или массив сообщений |
| instructions | string | — | — |
| max_output_tokens | integer | — | — |
| temperature | number | — | — |
| top_p | number | — | — |
| stream | boolean | — | — |
| tools | object[] | — | — |
| tool_choice | string | object | — | — |
| reasoning | object | — | — |
| effort | stringlowmediumhigh | — | — |
| summary | string | — | — |
| previous_response_id | string | — | — |
| truncation | stringautodisabled | — | — |
Ответы
200Ответ создан
| Поле | Тип | Обязательный | Описание |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created_at | integer | — | — |
| status | stringcompletedfailedin_progressincomplete | — | — |
| model | string | — | — |
| output | object[] | — | — |
| type | string | — | — |
| id | string | — | — |
| status | string | — | — |
| role | string | — | — |
| content | object[] | — | — |
| type | string | — | — |
| text | string | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | Количество токенов запроса |
| completion_tokens | integer | — | Количество токенов завершения |
| total_tokens | integer | — | Общее количество токенов |
| prompt_tokens_details | object | — | — |
| cached_tokens | integer | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| image_tokens | integer | — | — |
| completion_tokens_details | object | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| reasoning_tokens | integer | — | — |
Пример запроса
curl -X POST 'https://api.oletoken.ai/v1/responses' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string"
}'
