XRToken API Docs

Response (Responses API)

API Configuration
After saving, the Try It panel below sends real requests with this key.
Base: api.xrtoken.ai

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.

POST
/v1/responses

Authorization

BearerAuth
AuthorizationBearer <token>

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"
}