Responses API — альтернативный формат запросов
| Параметр | Тип | Описание |
|---|---|---|
model | string | ID модели |
input | string / array | Текст или массив сообщений |
instructions | string | Системные инструкции |
stream | boolean | Потоковая передача через SSE |
| Параметр | Тип | Описание |
|---|---|---|
tools | array | Определения инструментов |
tool_choice | string/object | Выбор инструмента: none, auto, required |
reasoning | object | Настройки reasoning (effort: xhigh/high/medium/low/minimal/none) |
max_output_tokens | integer | Максимум выходных токенов |
temperature | float (0-2) | Температура генерации |
top_p | float (0-1) | Nucleus sampling |
top_logprobs | integer (0-20) | Количество log probabilities |
previous_response_id | string | ID предыдущего ответа для продолжения |
models | array | Массив fallback-моделей |
text | object | Формат текста: text, json_object, json_schema |
metadata | object | Произвольные key-value данные |
stream: true ответ приходит в формате SSE с типами событий:
| Событие | Описание |
|---|---|
response.created | Ответ создан |
response.output_item.added | Новый элемент вывода |
response.content_part.delta | Инкрементальный контент |
response.content_part.done | Часть контента завершена |
response.done | Ответ завершён |
Input for response - can be string or array of messages
"Hello, how are you?"
Model to use
"openai/gpt-4"
System instructions
"You are a helpful assistant"
Metadata key-value pairs
Tools available for the model
Tool choice strategy
none, auto, required "auto"
Enable parallel tool calls
Alternative models to try
Text output configuration
Reasoning configuration
Maximum output tokens
1000
Temperature (0-2)
0 <= x <= 20.7
Top P (nucleus sampling)
0 <= x <= 11
Top logprobs
0 <= x <= 205
Maximum tool calls
5
Presence penalty (-2 to 2)
-2 <= x <= 2Frequency penalty (-2 to 2)
-2 <= x <= 2Top K sampling
40
Image configuration options
Output modalities
text, image Prompt cache key
Previous response ID
Enable streaming
Provider preferences
Уникальный идентификатор конечного пользователя для отслеживания и предотвращения злоупотреблений
"user-123"
Session identifier (max 128 chars)
Response ID
"gen_581761234567890123"
response "response"
Created timestamp
1234567890
Model used
"openai/gpt-4"
completed, in_progress, failed, cancelled "completed"
Full output text (convenience field)
"Hello! How can I help you today?"
Output items array
Completed timestamp
Error information
Usage information
Metadata key-value pairs