Endpoint
Authorization: Bearer sdn_.... 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
Withstream: 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. A response is persisted under your key by default (store defaults to true); 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
Turn 2 — chain on it
Reading a stored response back
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.404, so send the full
transcript for very large turns instead.
Errors
Standard status codes, OpenAI-shaped bodies. Retry on429/5xx with backoff and honor
retry-after. Full reference: Errors.