Responses

The OpenAI Responses API with previous_response_id continuation, encrypted reasoning and a WebSocket transport.

Create a response

Standard OpenAI Responses body on any catalog slug. Codex speaks only this API.

POST/v1/responses
curl https://api.experientiallabs.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-6-luna", "input": "Write a haiku about latency."}'

Continue with previous_response_id

Works on any worker, kept 30 days from the last turn, only while your organization keeps prompt capture on. store: false skips retention (that response cannot be continued). Nothing is stored with the upstream provider either way.

SituationResult
Unknown, expired, or capture off400 previous_response_not_found: resend the full conversation
Request routed under zero data retention400 zdr_continuation_disabled, unless the org sets zdr_continuation_storage (Data controls)
PUT/api/orgs/{org_id}/telemetry-settings
first = client.responses.create(model="gpt-6-luna", input="Pick a number from 1 to 10.")
second = client.responses.create(
    model="gpt-6-luna",
    previous_response_id=first.id,
    input="Double it.",
)
print(second.output_text)

Reasoning without server state

include: ["reasoning.encrypted_content"] returns sealed reasoning items you replay as input, so multi-turn agents keep hidden reasoning with store: false. An item sealed by another provider account is stripped and the lane re-dialed once; the response then carries x-gateway-replay-repair: encrypted_reasoning_stripped. Replay only items this gateway returned.

first = client.responses.create(
    model="gpt-6-astra", store=False,
    include=["reasoning.encrypted_content"],
    reasoning={"effort": "medium"},
    input=[{"role": "user", "content": "Plan the first step, then stop."}],
)
second = client.responses.create(
    model="gpt-6-astra", store=False,
    include=["reasoning.encrypted_content"],
    input=[
        {"role": "user", "content": "Plan the first step, then stop."},
        *[item.model_dump(exclude_none=True) for item in first.output],
        {"role": "user", "content": "Now do it."},
    ],
)

Prompt cache lifetime

prompt_cache_options: {"ttl": "12h"} asks OpenAI to keep the prefix 12 hours (GPT-5.6 and later, served by OpenAI); "30m" is the default. With no supporting route: 400 unsupported_capability, param: prompt_cache_options.ttl. 12-hour writes bill at 2.5x input. Writes by lifetime: usage.input_tokens_details.cache_write_tokens_details. Chat Completions accepts only "30m"; "12h" there is a 400 pointing here. More on caching.

{
  "model": "gpt-6-luna",
  "prompt_cache_options": {"ttl": "12h"},
  "instructions": "<long, unchanging system prompt>",
  "input": "Hello"
}

WebSocket transport

Upgrade GET /v1/responses (wss) with the same Authorization header; frames cross unchanged and previous_response_id works the same. A deployment without it answers 426 upgrade_required: POST over HTTP instead (Codex falls back on exactly this).

curl -i https://api.experientiallabs.ai/v1/responses \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Connection: Upgrade" -H "Upgrade: websocket" \
  -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ=="