OpenAI API: Realtime API on the Server

OpenAI API: Realtime API on the Server

40mGeneral2025-02-18

Authors

Morten Rand-Hendriksen

Morten Rand-Hendriksen

Senior Staff Instructor, Speaker, Web Designer, and Software Developer

Course details

With OpenAI’s Realtime API, you can build custom server-side real-time voice-to-voice AI chat into any application using WebSockets. In this course you’ll explore server-side integration of the Realtime API for tighter security and more advanced functionality. The course includes a hands-on example building on the WebRTC projects from the previous course, and covers how to capture and record user audio, send and receive audio and text, and integrate the server-side API app with a headless front-end app using vanilla JavaScript.

Learning objectives
Discover how to set up a server environment for accessing the Realtime API.
Discover how to capture and receive audio from a headless app and send it to the server.
Explore how WebSockets sends and receives audio and text from the API.

Skills covered

OpenAI APIAPIsOpenAIGenerative AIArtificial Intelligence (AI)Software DevelopmentOne-Off

Concepts

Introduction

  • Voice-to-voice chat over WebSockets
  • Prerequisites, references, and exercise files

Realtime API - Websockets Edition

  • Comparing approaches - WebSockets and WebRTC
  • Setup and walkthrough
  • Creating a WebSocket connection to the Realtime API
  • Sending and receiving events
  • The Realtime API reference
  • Sending and receiving audio messages
  • Function calling

Conclusion

  • Next steps
40,000 Toman