Response (Responses API)
OpenAI Responses API-compatible endpoint, passed through to the upstream. Supports both streaming (SSE) and non-streaming responses.
Differences from /v1/chat/completions: the request uses input instead of messages and max_output_tokens instead of max_tokens; the stream is typed events, ending with a response.completed event that carries usage.
Any chat model can be called; if the upstream does not support the Responses API, its error is passed through and the request is refunded. Clients that only support the Responses API (e.g. Codex) can point their base_url directly at this gateway.
Authorization
BearerAuth API key authentication (OpenAI format). Pass in the Authorization header:
Authorization: Bearer tr-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X post "https://api.xrtoken.ai/v1/responses" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "input": "Introduce yourself in one sentence" }'{
"id": "string",
"object": "response",
"status": "string",
"output": [
{}
],
"usage": {
"input_tokens": 0,
"output_tokens": 0,
"total_tokens": 0
}
}{
"error": "model field is required",
"type": "invalid_request_error"
}{
"error": "invalid or missing API key",
"type": "auth_error"
}{
"error": "insufficient balance -- please top up or upgrade your plan",
"type": "billing_error"
}{
"error": "rate limit exceeded",
"type": "rate_limit_error"
}{
"error": "upstream provider error",
"type": "server_error"
}