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.
POST https://api.qubax.ai/v1/responsesAll requests require an API key passed as a Bearer token in the Authorization header:
Authorization: Bearer qbx_live_...
Content-Type: application/json| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | ID of the model to use (e.g. gpt-5-mini). |
| input | string / array | Yes | The prompt. Either a plain string or an array of input items (the Codex format) with role and typed content parts. |
| instructions | string | No | System-style guidance for the model (equivalent to a system message). |
| max_output_tokens | integer | No | Maximum number of tokens to generate (equivalent to max_tokens). |
| stream | boolean | No | Stream events as Server-Sent Events. Default false. |
temperature, top_p, tools, reasoning, and more) are passed through to the model unchanged.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?"
}'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.
{
"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
}
}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.
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}}}Codex works with Qubax out of the box. In ~/.codex/config.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:
export QUBAX_API_KEY=qbx_live_...
codex --provider qubax "refactor this function"wire_api = "responses" line is what makes Codex call /v1/responses — the config this page documents. chat (Chat Completions) is also supported.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).