Responses API

The Responses API is OpenAI’s newer interface for building agents — the default wire format for tools like OpenAI Codex, and increasingly for agent frameworks. Qubax supports it natively: same models, same keys, same billing, no translation layer.

Endpoint

Text
POST https://api.qubax.ai/v1/responses

All requests require an API key passed as a Bearer token in the Authorization header:

Text
Authorization: Bearer qbx_live_...
Content-Type: application/json

Request Body

ParameterTypeRequiredDescription
modelstringYesID of the model to use (e.g. gpt-5-mini).
inputstring / arrayYesThe prompt. Either a plain string or an array of input items (the Codex format) with role and typed content parts.
instructionsstringNoSystem-style guidance for the model (equivalent to a system message).
max_output_tokensintegerNoMaximum number of tokens to generate (equivalent to max_tokens).
streambooleanNoStream events as Server-Sent Events. Default false.
ℹ️
Other Responses-API parameters (temperature, top_p, tools, reasoning, and more) are passed through to the model unchanged.

Basic Request

Shell
curl https://api.qubax.ai/v1/responses \\
  -H "Authorization: Bearer qbx_live_..." \\
  -H "Content-Type: application/json" \\
  -d '{
    "model": "gpt-5-mini",
    "input": "What is the capital of France?"
  }'

Response Format

A successful request returns a response object. The generated text lives in output — an array of output items; the message item’s content contains a part with type: "output_text". Token usage uses the Responses names input_tokens / output_tokens.

JSON
{
  "id": "resp_abc123",
  "object": "response",
  "status": "completed",
  "model": "gpt-5-mini",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [
        { "type": "output_text", "text": "The capital of France is Paris." }
      ]
    }
  ],
  "usage": {
    "input_tokens": 25,
    "output_tokens": 8,
    "total_tokens": 33
  }
}

Streaming

Set stream: true to receive Server-Sent Events. The event sequence matches OpenAI’s: lifecycle events (response.created, response.in_progress), text deltas (response.output_text.delta), and the terminal response.completed event, which carries the final usage for the whole request.

Text
data: {"type":"response.created","response":{"id":"resp_abc123"}}

data: {"type":"response.output_text.delta","delta":"The capital"}

data: {"type":"response.completed","response":{"id":"resp_abc123","usage":{"input_tokens":25,"output_tokens":8}}}

Using with OpenAI Codex

Codex works with Qubax out of the box. In ~/.codex/config.toml:

toml
[model_providers.qubax]
name = "Qubax"
base_url = "https://api.qubax.ai/v1"
env_key = "QUBAX_API_KEY"
wire_api = "responses"

Then export your key and run:

Shell
export QUBAX_API_KEY=qbx_live_...
codex --provider qubax "refactor this function"
💡
The wire_api = "responses" line is what makes Codex call /v1/responses — the config this page documents. chat (Chat Completions) is also supported.

Errors

Errors use the same JSON shape as the rest of the Qubax API — an error.message object with an HTTP status code (401 invalid key, 400 unknown model or malformed body, 402 insufficient credits, 429 rate limit).

Responses API · Qubax AI