Realtime API WebSocket

Opens a bidirectional WebSocket session to a realtime-capable provider (e.g. OpenAI Realtime, Azure Realtime preview). Bifrost proxies the upstream socket and applies governance, observability, and key selection on connect.

The target model is provided via the model query parameter (or deployment for Azure-style routes). The OpenAI SDK sends the API key over the openai-insecure-api-key.<key> WebSocket subprotocol; Bifrost extracts it and treats it the same as a Bearer header.

Inference auth applies — Bearer/Basic/Virtual Key/API Key headers are all accepted, plus the subprotocol form above.

GET
/v1/realtime
AuthorizationBearer <token>

Bearer token authentication. Use your MPilot virtual-key JWT or admin JWT. Virtual keys (prefixed with sk-bf-) can also be passed here.

In: header

Query Parameters

model?string

Provider model identifier in provider/model form (e.g. openai/gpt-4o-realtime-preview). Either model or deployment must be supplied; requests with neither (or both) are rejected with HTTP 400 before the WebSocket upgrade completes.

deployment?string

Azure deployment name (for Azure-style routes).

Header Parameters

Upgradestring

Must be websocket

Value in"websocket"
Sec-WebSocket-Protocol?string

Optional WebSocket subprotocol. Use openai-insecure-api-key.<key> to authenticate when headers cannot be supplied by the client.

Response Body

curl -X GET "https://loading/{AI_GATEWAY_URL}/v1/realtime?model=string&deployment=string" \  -H "Upgrade: websocket" \  -H "Sec-WebSocket-Protocol: string"
Empty
Empty
Empty
On this page

On this page

No Headings