Перейти к основному содержанию
POST
/
v1
/
responses
cURL
curl https://api.routify.ru/v1/responses \
  -H "Authorization: Bearer $ROUTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4.1",
    "input": "Tell me a short joke."
  }'
{}
/v1/responses — нативный прокси к OpenAI Responses API. Запрос передаётся провайдеру как есть, ответ возвращается без изменений. Поддерживается полная функциональность Responses API: tools, structured output, reasoning, previous_response_id, web search и другие возможности.

Примеры

curl https://api.routify.ru/v1/responses \
  -H "Authorization: Bearer $ROUTIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4.1",
    "input": "Привет! Как дела?"
  }'

Стриминг

stream = client.responses.create(
    model="gpt-4.1",
    input="Напиши короткий рассказ",
    stream=True,
)

for event in stream:
    if hasattr(event, "delta"):
        print(event.delta, end="", flush=True)

Биллинг

Тарификация по полям input_tokens, output_tokens и cached_tokens из ответа провайдера. При стриминге — из события response.completed.

Авторизации

Authorization
string
header
обязательно

Bearer authentication header of the form Authorization: Bearer $ROUTIFY_API_KEY.

Тело

application/json

Full OpenAI Responses API request. All fields are forwarded to the upstream provider as-is. For detailed parameter descriptions see https://developers.openai.com/api/reference/resources/responses/methods/create

model
string

Model ID used to generate the response. Use GET /v1/models to list all available models.

input

Text, image, or file inputs to the model, used to generate a response. Can be a string or an array of input items.

stream
boolean
по умолчанию:false

If set to true, the response is streamed using server-sent events. The stream ends with a response.completed event.

Ответ

Successful response (JSON or SSE stream)

The response is of type object.