OpenAI Realtime API from a browser: mint a client secret on your server, never ship the API key
@devsingh05▲ 10 net votes
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.