GPT Realtime API in Production: Routing, Governing and Billing Voice Sessions
GPT Realtime is OpenAI's speech-to-speech model family on the Realtime API, with GPT-Live as its duration-billed sibling. This guide covers connections, client secrets and billing, then shows how Bifrost routes, governs and prices every voice session.
TL;DR
- GPT Realtime models run on OpenAI's Realtime API at
/v1/realtime, connect over WebRTC, WebSocket or SIP, and bill audio, text and image tokens per response. - GPT-Live (
gpt-live-1) is a separate API at/v1/live/sessionsthat bills voice time per second at $0.05 per minute, with backend model calls billed separately. - Browser and mobile clients should never hold a standard API key; they connect with short-lived client secrets minted by a trusted server.
- Bifrost proxies realtime sessions over WebSocket and WebRTC, mints client secrets mapped to the originating virtual key, and prices realtime turns against budgets.
- Bifrost binds GPT-Live sessions to the opening virtual key, bills them in 30-second windows and re-checks governance at every window.
GPT Realtime is OpenAI's family of speech-to-speech models, served through the Realtime API, which connects over WebRTC, WebSocket or SIP and bills each response by audio and text tokens. At production scale it raises key exposure, per-session cost and audit problems that the API leaves to the application. Bifrost, the open-source AI gateway built in Go by Maxim AI, sits in front of realtime and live voice sessions so routing, budgets and logs apply to voice traffic the same way they apply to text.
What Is GPT Realtime? Realtime API and GPT-Live in October 2026
GPT Realtime is a set of OpenAI models that take audio in and produce audio out within one session, with tool calling and turn handling built in. As of October 2026, OpenAI ships two voice APIs: the Realtime API for gpt-realtime models and GPT-Live for full-duplex conversations that delegate work to a backend model.
OpenAI's Realtime API guide describes the GA interface: ephemeral credentials from POST /v1/realtime/client_secrets, WebRTC through /v1/realtime/calls, and a session.type field on every session. Current models include gpt-realtime-2.1, gpt-realtime-2.1-mini, gpt-realtime-2 and gpt-realtime-1.5; the original gpt-realtime snapshot is now marked deprecated.
GPT-Live is the newer API. Its model, gpt-live-1, listens while it speaks and delegates tool use and reasoning to a backend model or agent. A server can attach a second WebSocket, called a sideband, to monitor or control the session while audio stays on the primary connection.
| Attribute | Realtime API | GPT-Live |
|---|---|---|
| Example models | gpt-realtime-2.1, gpt-realtime-2.1-mini |
gpt-live-1 |
| Endpoint | /v1/realtime |
/v1/live/sessions |
| Connections | WebRTC, WebSocket, SIP | WebRTC (recommended), WebSocket, SIP |
| Billing unit | Tokens per response (audio, text, image) | Voice duration per second, plus backend usage |
| Reasoning and tools | Inside the realtime session | Delegated to a backend model or agent |
| Concurrency limit | Requests and tokens per minute | Concurrent sessions (50, 300 or 500 by tier) |
For how OpenAI's text APIs differ, see the comparison of the Responses API, Chat Completions and Anthropic Messages.
How the OpenAI Realtime API Connects: WebSocket, WebRTC and SIP
The OpenAI Realtime API supports three transports. WebRTC is recommended for browser and mobile clients because it carries audio on media tracks and events on a data channel. WebSocket suits server-to-server integrations where a standard API key stays on the backend. SIP connects phone calls, with a sideband WebSocket for events and commands.
- WebRTC: the browser creates an SDP offer and exchanges it for an answer, through your server or with an ephemeral key. Media then flows for the session's lifetime.
- WebSocket: one socket carries base64 audio and JSON events in both directions, authenticated with a key held on the server.
- SIP: your server accepts an inbound call by
call_id, and a sideband WebSocket handles transcripts, tools and transfers while SIP carries the audio.
Ephemeral client secrets are the browser-side credential: a trusted server calls the client secrets endpoint with its own key and returns a token the browser uses to connect. OpenAI's client secret reference sets the lifetime between 10 and 7,200 seconds, defaulting to 600.
Bifrost implements the same contracts, so existing clients only change their base URL: the realtime WebSocket at /v1/realtime, the WebRTC SDP exchange at /v1/realtime/calls and client secret minting at /v1/realtime/client_secrets, with OpenAI-prefixed aliases. Any proxy in front of the gateway must pass WebSocket upgrades, as the runtime contract and the NGINX reverse proxy guide describe.
OpenAI Realtime API Pricing: How Voice Sessions Are Billed
OpenAI Realtime API pricing is token-based: each response is charged for its input and output tokens across audio, text and image, and the full conversation is sent as input on every turn. GPT-Live pricing is duration-based at $0.05 per minute, billed per second, with backend model and tool calls charged at their normal rates.
The figures below come from OpenAI's API pricing page, read on October 26, 2026. Prices are per 1M tokens unless noted.
| Model | Audio input | Audio output | Text input | Text output | Cached input |
|---|---|---|---|---|---|
gpt-realtime-2.1 |
$32.00 | $64.00 | $4.00 | $24.00 | $0.40 |
gpt-realtime-2.1-mini |
$10.00 | $20.00 | $0.60 | $2.40 | $0.30 audio, $0.06 text |
gpt-realtime (deprecated) |
$32.00 | $64.00 | $4.00 | $16.00 | $0.40 |
gpt-live-1 |
$0.05 per minute of voice time, billed per second |
Three rules from OpenAI's voice cost optimization guide shape the bill:
- Audio token rates differ by speaker. User audio counts as 1 token per 100 ms and assistant audio as 1 token per 50 ms, so one minute of model speech is about 1,200 output tokens, roughly $0.077 at the
gpt-realtime-2.1rate. - Later turns cost more. Every response resends the conversation as input; caching and truncation are the levers.
- GPT-Live bills time, not tokens. Silence, backend waits and idle connections all count, and a WebRTC GPT-Live session bills 15 seconds at creation, credited once it runs.
Cost therefore depends on call length and how promptly sessions close; the LLM cost calculator helps compare rates.
Production Problems with GPT Realtime Voice Sessions
Realtime voice moves the hard problems from model quality to operations. Production teams run into five recurring issues: provider keys reaching browsers, sessions that accrue cost with no cap, no per-team governance, transcripts that are either missing or over-retained, and code tied to one provider's realtime contract.
| Problem | Without a control point | Gateway-level control |
|---|---|---|
| Key exposure | A standard API key ships in a web bundle or mobile app | Server-side virtual key, short-lived client secrets for clients |
| Per-session cost | Long or idle calls accrue tokens or seconds with no cap | Budgets per key, team and customer, priced per turn or window |
| Governance | Any caller can open any model on any key | Allowed models, separate live request type, deny-by-default providers |
| Transcript logging | Nothing is recorded, or everything is kept | Session log rows with configurable content logging |
| Provider choice | Code is written against one vendor's socket contract | One realtime endpoint routing to OpenAI, Azure or xAI |
Cost control is the least obvious: a connect-time budget check does not stop a call that runs for an hour, so governance has to run during the session. The patterns for hierarchical LLM spend controls with virtual keys apply, with the unit of cost being an open socket.
Routing GPT Realtime Sessions Through Bifrost
The Bifrost AI gateway routes realtime voice sessions through the same authenticated endpoint as text traffic. On connect, it selects a provider key, evaluates governance and starts observability, then proxies the upstream socket or WebRTC media for the session's lifetime. The target model is named in provider/model form, such as openai/gpt-realtime-2.1.

Figure 1: Every voice session enters through one authenticated endpoint, so key selection, budgets and logs apply before audio reaches a provider.
As Figure 1 shows, clients differ only in credential type: servers present a virtual key, and browsers present a client secret. The OpenAI SDK sends credentials over the openai-insecure-api-key.<key> WebSocket subprotocol, which Bifrost treats the same as a Bearer header, so SDK code works unchanged.
Provider choice becomes a routing decision. Bifrost supports OpenAI and Azure realtime, with Azure deployments selected by a deployment parameter. Since v2.3.0, xAI is also a realtime voice provider on the WebSocket gateway, including client secret minting and the xai-client-secret.<token> subprotocol for browsers.
Two details apply to long-lived connections:
- Session affinity is read-only on realtime paths. Realtime connections reuse a key bound by earlier requests in the same session but never create or refresh a binding, per the session affinity docs.
- Connection limits are configurable. The
websocketblock setsmax_connections_per_user(default 100), pool sizes, connection lifetimes andtranscript_buffer_size, the transcript entries buffered for realtime mid-session fallback. See the config schema reference.
The same gateway serves one OpenAI-compatible API to 10,000+ models across 25+ providers, as the LLM gateway page summarizes.
Keeping Keys Out of the Browser with Ephemeral Client Secrets
The safe browser pattern is a server-minted, short-lived client secret. With Bifrost, the application server calls /v1/realtime/client_secrets with its virtual key; Bifrost selects a provider key, evaluates governance, mints the secret upstream and returns a Bifrost-issued token that maps back to the originating virtual key for attribution.

Figure 2: The browser only ever holds a short-lived secret that maps back to the virtual key that minted it.
Bifrost returns its own token rather than the provider's token verbatim, so a client cannot take the secret and connect to the provider directly, outside metering.
Turn on enforce_auth_on_inference in the client configuration as well: connections to /v1/realtime and /v1/realtime/calls are then refused with 401 unless they carry a virtual key, API key, user token or a Bifrost-minted client secret. Dashboard login does not protect inference routes, so the security best practices guide lists realtime among the routes needing this control. For xAI, send session settings with session.update after connecting, because xAI mint requests that carry them are rejected.
GPT Live API Sessions: Governing and Billing in 30-Second Windows
Bifrost proxies OpenAI GPT-Live sessions over WebSocket and WebRTC at /v1/live/sessions, with sideband attach and recording download routes. Voice time is billed in 30-second windows from the live pricing row, governance is re-checked at each window, and each session is bound to the virtual key that opened it.

Figure 3: Governance runs again at every 30-second window, so a budget or access change takes effect inside a running conversation.
As Figure 3 shows, if budgets and limits or key access change mid-call, later billing units on a key that governance now excludes return 403, and provider keys are only picked from those the virtual key allows.
The rest of the GPT-Live surface is covered too:
- Sideband attach at
/v1/live/sessions/{session_id}/attachruns through the plugin pipeline as alive_sidebandrequest with its own log row. - Recording download at
/v1/live/sessions/{session_id}/contentis logged aslive_content;?provider=orx-model-providerselects the provider on both routes. - Backend delegation is billed per turn, and a failed delegation is recorded on the delegation instead of failing the session.
- Failures are explicit: an upstream that ends without
session.closedreturns502 server_error, and a failed WebRTC setup still records OpenAI's 15-second minimum.
Live access is a separate grant: Bifrost has a dedicated live allowed request type, and allowing realtime does not imply it, so a team approved for gpt-realtime-2.1 cannot open gpt-live-1 sessions until live is allowed. Realtime WebSocket and WebRTC turns on models such as openai/gpt-realtime are priced from the realtime pricing row, so log costs and budgets reflect real usage, and negotiated rates can be applied with custom pricing overrides. The AI governance page covers the policy layer around these checks.
Logging Transcripts and Attributing Voice Cost
For GPT-Live, Bifrost writes one session log row carrying the transcript, delegations and costs, while sidebands and recording downloads get their own rows. Realtime sessions are logged per turn with cost attached. Spend is attributed to the virtual key that opened the session, and through it to teams, customers and cost centers.
Voice calls often contain account numbers and health details, so decide retention before enabling transcript logging. Content logging can be disabled globally or per virtual key, with separate flags for object storage and each observability connector, while the built-in observability view still shows metadata, latency and cost.
Cost attribution follows the key:
- Metadata on the virtual key, such as
cost_centerorenv, is copied into every log entry the key produces, so voice spend filters by cost center without callers sending headers. - Hierarchical budgets check the virtual key, team and customer independently; the budget and rate limit architecture for multi-tenant platforms applies directly to voice products sold per customer.
- Projects on Bifrost Enterprise scope a request's budget, and the same project resolution governs LLM, streaming, realtime and MCP paths.
The per-team cost attribution reporting layer turns these fields into a chargeback view.
Production Checklist for GPT Realtime Through Bifrost
A production rollout through the gateway takes four steps: create a voice virtual key with model and budget limits, enforce authentication on inference routes, mint client secrets server-side, and separate realtime from live access.
1. Create a virtual key scoped to voice models, with a monthly budget and attribution metadata:
curl -X POST <https://bifrost.internal.example.com/api/governance/virtual-keys> \
-H "Content-Type: application/json" \
-d '{
"name": "voice-support-agent",
"metadata": { "cost_center": "cc-voice", "env": "prod" },
"provider_configs": [
{
"provider": "openai",
"allowed_models": ["gpt-realtime-2.1", "gpt-realtime-2.1-mini"],
"key_ids": ["*"],
"budgets": [{ "max_limit": 500.00, "reset_duration": "1M" }]
}
]
}'
With allow-all off, provider access is deny-by-default, so this key reaches no other provider. The same model governs LLM and MCP traffic with virtual keys.
2. Enforce authentication with "client": { "enforce_auth_on_inference": true } in config.json, and size the websocket block for expected concurrency.
3. Mint client secrets on the server. Browsers call your backend, the backend calls /v1/realtime/client_secrets with the virtual key, and the browser connects to /v1/realtime/calls with the returned secret.
4. Separate realtime from live. Allow the live request type only where GPT-Live is used, give live traffic its own key and budget, and keep the sideband on the server. Alerts follow the patterns in controlling LLM costs with budget alerts and rate limits, and the governance resource page summarizes the full control set.
Bifrost is self-hosted and air-gapped by default, with SOC 2 Type II, ISO 27001, HIPAA and GDPR compliance, as the enterprise page describes, so voice transcripts stay in the customer's infrastructure.
Frequently Asked Questions
What is GPT Realtime?
GPT Realtime is OpenAI's family of speech-to-speech models on the Realtime API, including gpt-realtime-2.1 and gpt-realtime-2.1-mini. The models accept audio, text and image input, return audio and text, call tools within the session, and connect over WebRTC, WebSocket or SIP. The original gpt-realtime snapshot is deprecated. Routing the models through the open-source Bifrost gateway adds virtual key governance and per-turn cost tracking.
How much does the OpenAI Realtime API cost?
The OpenAI Realtime API bills tokens per response. On October 26, 2026, gpt-realtime-2.1 cost $32 per 1M audio input tokens, $64 per 1M audio output tokens and $0.40 per 1M cached input tokens. User audio counts as 1 token per 100 ms and assistant audio as 1 token per 50 ms. Budgets on a virtual key hierarchy cap the total per team.
What is the difference between GPT Realtime and GPT-Live?
GPT Realtime models run on /v1/realtime, handle reasoning and tools inside the voice session, and bill by tokens. GPT-Live (gpt-live-1) runs on /v1/live/sessions, listens while it speaks, delegates reasoning to a backend model, and bills voice time at $0.05 per minute. Bifrost treats them as separate request types, so access to one does not grant the other; the AI governance overview explains how those grants are managed.
Should I use WebRTC or WebSocket for the OpenAI Realtime API?
Use WebRTC for browser and mobile clients, because it carries audio on media tracks. Use WebSocket for server-to-server connections and SIP for phone calls. Bifrost proxies both WebRTC and WebSocket, so the choice does not change governance; proxies in front of it must pass WebSocket upgrades per the deployment runtime contract.
How do I keep my OpenAI API key out of the browser?
Mint an ephemeral client secret on your server and send only that token to the browser. The server calls /v1/realtime/client_secrets with a virtual key, and Bifrost returns its own short-lived token mapped to that key, so the browser never sees a provider key. Turning on enforce_auth_on_inference in the client settings refuses unauthenticated realtime connections.
Can I set a budget for realtime voice sessions?
Yes. Bifrost prices realtime turns from the realtime pricing row and GPT-Live voice time from the live pricing row, so both count against virtual key, team and customer budgets. GPT-Live sessions are re-checked every 30 seconds, and later billing units on a key that governance excludes return 403. Budget configuration is covered in the budget and limits docs.
Run GPT Realtime Through One Governed Gateway
OpenAI's realtime and live models make voice agents practical, and Bifrost handles the production work at the gateway: client secrets mapped to virtual keys, realtime and live pricing applied to budgets, governance re-checked during live calls, and one endpoint for OpenAI, Azure and xAI realtime traffic. To see GPT Realtime sessions routed, governed and billed in your own environment, book a demo with the Bifrost team.