API reference · Responses

Responses.

The OpenAI Responses dialect on the lx1 catalog — the wire protocol the Codex CLI uses. Send input, receive typed output items, stream with SSE.

Endpoint

POST/v1/responses

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

ParameterTypeNotes
modelstring · requiredAny catalog id.
inputstring | array · requiredA plain string, or a list of input items (messages, tool results).
instructionsstringSystem-level guidance for the run.
max_output_tokensintegerOutput ceiling. On reasoning models, hidden reasoning counts against it.
temperaturenumberSampling temperature.
toolsarrayFunction tools. See Tool calling.
streambooleanSSE event stream when true.
Note

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

curl https://api.layerx1.in/v1/responses \
  -H "authorization: Bearer $LAYERX1_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "lx1-gpt-oss-120b",
    "input": "Say hi."
  }'
Create a response
{
  "id": "resp_...",
  "object": "response",
  "model": "lx1-gpt-oss-120b",
  "output": [{
    "type": "message",
    "role": "assistant",
    "content": [{ "type": "output_text", "text": "Hi." }]
  }],
  "usage": { "input_tokens": 14, "output_tokens": 3 }
}
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.

Errors

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