Responses API
Отправьте запрос на POST /responses и прочитайте ответ в формате этого API.
Запрос
curl
curl https://api.closerouter.dev/v1/responses \
-H "Authorization: Bearer $CLOSEROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-5.4-mini",
"input": "Reply with exactly: ok",
"max_output_tokens": 16
}'Ответ
Сокращённый пример ответа.
JSON
{
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "ok"
}
]
}
]
}Основные параметры
| Поле | Назначение |
|---|---|
model | ID модели из каталога. Поддержка параметров зависит от провайдера и API. |
input | Текст или поддерживаемый Responses-ввод. |
max_output_tokens | Лимит токенов ответа в Responses. |