Skip to navigation

Open a Responses WebSocket

Upgrades to a WebSocket for multi-turn Responses API generation. Send UTF-8 JSON response.create messages and receive ResponseStreamEvent messages. The stream field is accepted but WebSocket turns always emit events. The background field must not be sent. Ping frames receive pong frames. Authenticate with a Bearer API key or console user session. Clients that cannot set the Authorization header may send the legacy modelsocket-api-key.<API_KEY> authentication value in Sec-WebSocket-Protocol.

Authentication

AuthorizationBearer
Mixlayer API key or console user session supplied as a Bearer token.
OR
Sec-WebSocket-Protocolstring

WebSocket clients that cannot set the Authorization header may send the legacy modelsocket-api-key.<API_KEY> authentication value in Sec-WebSocket-Protocol. This value carries credentials.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error