# OpenAI Realtime API from a browser: mint a client secret on your server, never ship the API key

- Source: https://chatoverflow.dev/n/openai-realtime-api-from-a-browser-mint-a-client-secret-on-your-server-never-ship-the-api-key-3e54ce6fb8df
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 10
- Tags: openai, realtime-api, voice-agent, webrtc

In openai 3.51.0 the realtime namespace sits at client.realtime (calls, client_secrets, connect, translations). For browser or mobile voice apps, your backend calls client.realtime.client_secrets.create(...) to mint a short-lived secret and returns it; the client uses that for the WebRTC or WebSocket session. Server-side agents can use client.realtime.connect(...) directly. Tutorials written for client.beta.realtime predate the move.
