OpenAI Realtime on ESP32
Espressif's WebRTC voice chat demo.

By Espressif
- Posted
- GitHub stars
- 410 (GitHub)
What you need
- Difficulty
- Intermediate ยท Our suggestion
- License
- Demo code: Public Domain or CC0 (source)
Parts
- ESP32-S3-Korvo-2 (default board; others via esp_board_manager) (board)
- AI model or service
- OpenAI Realtime API (GA WebRTC flow, per Espressif's README)
Overview
Espressif's openai_demo connects an ESP32 board to OpenAI for real-time chat. It is part of the esp-webrtc-solution repo, uses esp_webrtc and runs by default on the ESP32-S3-Korvo-2. Espressif's README lists OPUS encoding and decoding and acoustic echo cancellation, and predefined function calls let voice commands switch a light on and off, change its colour, set the speaker volume and open a door. The demo source files are public domain or CC0.
How it works
Per Espressif's README, the demo uses the OpenAI Realtime GA WebRTC ephemeral-token flow: the board uses your API key to request a short-lived client secret from /v1/realtime/client_secrets, then exchanges SDP with /v1/realtime/calls using that token; no STUN or TURN server is used. To build, install ESP-IDF (release v5.4 or master), set Wi-Fi in main/settings.h, export OPENAI_API_KEY, pick your board with esp_board_manager (idf.py gen-bmgr-config) and flash. After boot it joins Wi-Fi and connects to OpenAI on its own; console commands start and stop the chat.
Hardware
- ESP32-S3-Korvo-2 (default board; others via esp_board_manager)
Like this build? Get the weekly builds
Every Thursday: the 5 best gadget hacks you can copy. Free.
Built something? Submit a build
Credits and links
- Espressif: Creator
- WquGuru (@wquguru): Featured it in a roundup of OpenAI's hardware gallery
- License: Demo code: Public Domain or CC0 (source)
This page is a short summary written by HardwareLab. Build steps, code and photos belong to the creator; follow โView originalโ for the full project.
Featured? Add this badge
Built this? Paste the badge into your README. It links back to this page.
Markdown
[](https://hardwarelab.dev/projects/openai-realtime-esp32/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w)HTML
<a href="https://hardwarelab.dev/projects/openai-realtime-esp32/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w"><img src="https://hardwarelab.dev/badge.svg" alt="Featured on HardwareLab" width="188" height="20"></a>Related builds
All 44 in Voice Assistants & CompanionsLocal Xiaozhi on a Waveshare ESP32-S3 audio board
A Xiaozhi voice assistant that only talks to your own LAN server.
- Waveshare ESP32-S3-AUDIO-Board (ES8311/ES7210, dual mic AEC, amp, RGB LEDs)
IntermediateESP32-S3 voice frontend
An ESP32-S3 voice frontend that keeps GPIO and network actions local.
- ESP32-S3
- INMP441 I2S mic
- MAX98357A amp/speaker (Gerbers optional)
Intermediate

KALO ESP32 Voice Chat AI Friends
Chat with several custom AI friends on an ESP32.
- ESP32
- mic
- speaker
Intermediate76
ESP32 AI LLM
ESP32 voice chat with 15 LLMs, wake word and live on-screen text.
- ESP32/ESP32-S3
- mic
- display
Intermediate572