A simple command-line-based python console for testing and interacting with the OpenAI Realtime API, inspired by the official OpenAI Realtime Console app.
- Push-to-talk audio recording
- Audio playback
- An async Python client for the OpenAI Realtime API
-
Clone the repository:
git clone https://github.com/S4mpl3r/openai-realtime-console-py.git cd openai-realtime-console-py
-
Create a virtual environment and activate it.
Windows:
python -m venv .venv .venv\Scripts\activate
MacOS/Linux:
python3 -m venv .venv source .venv/bin/activate
-
Install dependencies:
Windows:
python -m pip install -r requirements.txt
MacOS/Linux:
python3 -m pip install -r requirements.txt
-
Create a
.env
file and add your OpenAI API key:OPENAI_API_KEY="your-api-key"
-
Run the console:
Windows:
python console.py
MacOS/Linux:
python3 console.py
-
Press and hold the
space
bar to talk, release to stop. Pressq
to quit.
This project is licensed under the MIT License.