Skip to main content

Endpoint

Authenticate with Authorization: Bearer lx1_.... This is the surface a Codex provider block with wire_api = "responses" talks to — see the Codex CLI guide.

Request parameters

On reasoning models a very small max_output_tokens can be consumed entirely by hidden reasoning, leaving an empty output_text. If you see empty outputs, raise the budget — 4,000+ is a safe floor for reasoning models.

Example

Response (shape)

Streaming

With stream: true the response is an SSE event stream — typed events such as response.output_text.delta as text generates, closed by response.completed. The OpenAI SDKs’ responses.stream(...) helpers consume it unchanged. See Streaming.

Stateful conversations

Responses is the one chat dialect that can hold the conversation for you. Set store: true and the response is persisted under your key; a later turn then chains on it by id and sends only the new input, instead of re-uploading the whole transcript. This is the OpenAI SDK’s default conversation pattern, and it works here unchanged.
Turn 1 — store it
Turn 2 — chain on it
Both fields are echoed back on every envelope, so a client can always see what it is chained to.

Reading a stored response back

Returns the exact envelope you already received — the same bytes, replayed. Authenticated like every other data route, and scoped to your key: an id belonging to someone else is a 404, never their response.
Chaining on an unknown or expired id is a 404 with an invalid_request_error body, naming only the id you sent. That is deliberate: a loud failure beats a conversation that silently lost its history and answers as if the earlier turns never happened.
Only responses you asked to store are stored. Without store: true nothing is persisted for chaining and GET /v1/responses/{id} has nothing to return — send the full transcript each turn instead, exactly like Chat Completions.

Errors

Standard status codes, OpenAI-shaped bodies. Retry on 429/5xx with backoff and honor retry-after. Full reference: Errors.