Skip to main content

Endpoint

Compatible with the OpenAI Responses API in stateless mode. Every chat model in the catalog is available through it, with the same billing, quotas, and logging as Chat Completions. The main reason this endpoint exists: recent versions of the Codex CLI only speak the Responses wire (wire_api = "chat" was removed), so this is what lets Codex — and any other Responses-only client — use RouterBase as its provider.

Using RouterBase with Codex

Add a provider to ~/.codex/config.toml:
Then export your key and run Codex as usual:
Codex’s default stateless behavior for custom providers (resend the full history, store: false) is exactly what this endpoint expects — no extra configuration needed.

Request Headers

Request Body

string
required
Model ID (chat models only). See the Model Overview or the live Models API.
string | array
required
A plain string (treated as a single user message) or an array of input items. Supported item types: message (roles user, assistant, system, developerdeveloper maps to system), function_call, function_call_output, and reasoning (accepted and skipped). Message content may be a string or typed parts (input_text, output_text, input_image).
string
System-level instructions, prepended as a system message.
integer
Maximum tokens to generate.
number
Sampling temperature, 0–2.
number
Nucleus sampling probability, 0–1.
boolean
If true, the response is a Server-Sent Events stream of response.* events: response.createdresponse.output_item.addedresponse.output_text.delta … → response.output_item.doneresponse.completed. Function-call items arrive complete in response.output_item.done.
array
Function tools in the flat Responses shape: {"type": "function", "name": "...", "description": "...", "parameters": {...}}. Server-side tool types (web_search, …) are accepted and silently dropped — RouterBase does not host them; the model simply does not get that tool.
string | object
"auto", "none", "required", or {"type": "function", "name": "..."}.

Stateless by design

previous_response_id and server-side conversation storage are not supported — requests carrying previous_response_id return a 400 with guidance. Send the full item history each turn (with store: false if your client sends it; the field is accepted and ignored). This is the default mode for Codex with custom providers and for most Responses SDK usage.

Examples

Response

When the model calls a tool, the output array carries function_call items (call_id, name, arguments); return each result as a function_call_output item in the next request’s input.

Billing

Identical to Chat Completions: the request runs through the same pipeline, is metered by the same token pricing, and appears in your generation logs the same way.