Get API key
InferenceResponses WebSocket
Inference

Responses WebSocket

The same Responses API over a WebSocket, the transport the Codex CLI uses. Send response.create frames; each Responses stream event arrives as one text frame, and a request that fails arrives as an {"type": "error", ...} frame. The key is checked before the upgrade is accepted. A GET without an upgrade answers 426.

GET/api/v1/responses
Response
{
  "error": {
    "code": 401,
    "message": "A valid gateway Bearer key is required. Send the virtual key as 'Authorization: Bearer <key>'.",
    "metadata": {
      "error_type": "authentication",
      "gateway_code": "invalid_key"
    }
  }
}

Authorization

An inference key, as Authorization: Bearer KEY.

Keys and limits

Parameters

  • Upgradestringheaderrequired

    websocket.

Response 101

The connection switches to the WebSocket.

Errors

  • 401

    No key, or the key is unknown, expired, revoked or disabled.

  • 426

    A GET without a well-formed upgrade. Clients such as Codex fall back to POST /api/v1/responses.

Every error code

Docs