GET /v1/realtime tunnels a WebSocket session to an OpenAI or Azure OpenAI realtime model. Your client authenticates with a ManyLayers credential; the gateway checks access and limits, attaches the provider credential, and relays the session.
How it works
- The gateway reads
modelfrom the query string and checks that your team may use it. - It resolves the model from the configured catalog (
gateway.yaml) and checks the provider isopenaiorazure. - It evaluates your access policies, model restrictions, rate limits and budgets.
- It dials the provider, sends the upgrade with the provider’s own credential (your gateway key is never forwarded), and relays the provider’s handshake response.
- After the upgrade, frames flow in both directions unmodified until either side closes.
Configuration structure
Realtime models are ordinarygateway.yaml models (self-hosted configuration) whose first upstream is openai or azure. Only the host of url is used; the gateway builds the realtime path itself.
Key fields
?model=: Required. The gateway model name. Missing returns400 missing_model.- Upstream
model: Sent to OpenAI as?model=, or to Azure as?deployment=on/openai/realtime. Defaults to the gateway model name. api_version(Azure): Defaults to2024-10-01-preview.
Connect
OpenAI-Beta: realtime=v1 header to the upstream handshake. Sec-WebSocket-Protocol from your client is forwarded.
Common configurations
Limit who can open sessions
Limit who can open sessions
Use team model access and policies. Access policies, model restrictions, request rate limits and budgets are checked once, when the session opens. Per-request token ceilings don’t apply, because the gateway doesn’t read the session’s content.
Browser clients
Browser clients
Browsers can’t set an
Authorization header on a WebSocket, and the gateway reads no credential from the query string. Open the session from your backend and relay audio to the browser.What the gateway does and doesn’t do
| Applies | Doesn’t apply |
|---|---|
| Authentication and team model access | Guardrails, firewall and PII redaction (frames aren’t inspected) |
| Access policies, model restrictions, rate limits, budgets (at connect) | Caching |
| One audit record per session, with status and duration | Token counting — sessions are metered with zero tokens |
| Request count and duration metrics | Failover: only the model’s first upstream is used |
Realtime models must be defined in
gateway.yaml; console-registered workspace providers don’t serve /v1/realtime, so such a model returns 404 model_not_found. A non-openai/azure provider returns 400 unsupported_provider, and a request without Upgrade: websocket returns 400 websocket_upgrade_required. If the upstream can’t be reached, the client gets 502 upstream_error.Next steps
Endpoints
Every path the gateway serves.
Policies
Rate limits and budgets checked at connect.
Providers
Configure OpenAI and Azure upstreams.
Making Requests
Authentication and errors.