Responses API
OpenAI-compatible POST /v1/responses endpoint with native response.* event schemas for streaming.
POST /v1/responses is a drop-in replacement for the OpenAI Responses API — the modern protocol built around response objects and structured response.* events. Existing Responses-API code runs against the gateway with a base-URL change only.
Endpoint#
/v1/responsesCreate a response. Non-streaming responses return a full response object; streaming emits native response.* events and ends with response.completed.
Parameters
The model identifier (`<public-name>`). See [Model Catalog](/en/docs/api-reference/models).
The prompt, either as a plain string or as an array of content parts.
falseSet `true` to receive Server-Sent Events. See [Streaming & SSE](/en/docs/api-reference/streaming).
Request Example
curl -X POST "https://api.zrouter.dev/v1/responses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "<public-name>",
"input": "Say hello!"
}'Responses
{
"id": "resp_...",
"object": "response",
"created_at": 1720000000,
"model": "<public-name>",
"output": [
{
"type": "message",
"content": [{ "type": "output_text", "text": "Hello!" }]
}
],
"usage": { "input_tokens": 8, "output_tokens": 3, "total_tokens": 11 }
}Streaming#
With "stream": true the gateway relays the native response.* event stream from the upstream unchanged. The terminal response.completed event carries the complete output (including the final usage block). Full examples are in Streaming & SSE.