I’m reaching out to request your assistance in providing a working example of OpenAI Real-Time API with a split frontend and backend setup. The current documentation only includes a frontend solution, which poses a risk of exposing the API key. A comprehensive example demonstrating how to implement both frontend and backend components would be immensely helpful for developers looking to integrate your API without compromising security.
While not an official example, here is our Real-Time API front-end and back-end solution. We are leveraging the open-source Your Priorities platform and the Policy Synth AI library.
Our solution integrates a hybrid voice/text interface. We are using WebSockets to send audio to the client but plan to upgrade this functionality to WebRTC soon.
The OpenAI API key is never exposed to the front-end and we use our own user/role system to control access. So pretty much exactly like in the quote above about secure usage of the API.