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.
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.
Parameters
Upgradestringheaderrequiredwebsocket.
Response 101
The connection switches to the WebSocket.
Errors
401No key, or the key is unknown, expired, revoked or disabled.
426A
GETwithout a well-formed upgrade. Clients such as Codex fall back toPOST /api/v1/responses.