Skip to main content
The AI Gateway exposes two WebSocket endpoints: one for realtime speech and audio models, and one that runs Responses API turns over a single connection. Both authenticate with the workspace API key in the upgrade request; a rejected upgrade returns an HTTP error status.

Realtime sessions

Send Authorization: Bearer $ORQ_API_KEY in the upgrade request. model is required: a missing value returns 400, an unknown model 404, and a model without a realtime protocol 400. The endpoint routes Grok Voice and GPT-Live models. See supported realtime models. A session counts against the workspace’s rate limits and budgets when it connects. An exhausted limit rejects the upgrade; see Errors.

Grok Voice

The gateway proxies the OpenAI Realtime event protocol: JSON events in both directions and binary frames for audio. The Grok Voice constraints, audio formats, and billing are listed under Realtime models.
An upstream refusal arrives as an error event on the open socket rather than as an HTTP status, because the upgrade has already completed.

GPT-Live

Connect to wss://my.orq.ai/v3/router/realtime?model=openai/gpt-live-1.1 with a key that grants realtime.execute. Send a Live session.start event first.
Wait for session.started before sending base64 audio in session.input_audio.append. Play audio from session.output_audio.delta. Send session.close and wait for session.closed to receive final usage. Run delegated work in the calling application. OpenAI Live WebSocket protocol

WebRTC and standby

Send an SDP offer to POST /v3/router/live/sessions with the same permission. Apply transport.sdp from the 201 response as the remote answer. Use the oai-events data channel for Live events.
wake_policy starts inference when speech is detected. idle_timeout_s returns the session to standby after inactivity. GPT-Live is billed by the second at $0.05 per active minute and $0.02 per standby minute. WebSocket sessions use the active rate. OpenAI Live session pricing

Responses over WebSocket

Upgrade with the openai-beta.responses.v1 subprotocol and Authorization: Bearer $ORQ_API_KEY. Each client message creates or steers a response; the server streams the same events as an HTTP streaming request.
  • One turn at a time. Send the next response.create after the previous turn’s terminal event.
  • stream_id labels the turn and correlates the events that belong to it.
  • response.steer takes a previous_response_id and input, and steers the live turn that produced that response. A failure arrives as a response.steer.failed event with a code such as response_not_found or steering_not_supported.
  • Connection lifetime is 30 minutes; the server sends a connection_duration_exceeded error event and closes the socket. Reconnect and continue with previous_response_id, which fails with previous_response_not_found when the response has expired.

Errors