https://github.com/openai/openai-voice-agent-sdk-sample
Sample application to add voice capabilities to the Agents SDK
https://github.com/openai/openai-voice-agent-sdk-sample
Last synced: 2 months ago
JSON representation
Sample application to add voice capabilities to the Agents SDK
- Host: GitHub
- URL: https://github.com/openai/openai-voice-agent-sdk-sample
- Owner: openai
- License: mit
- Created: 2025-04-08T14:33:08.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-09T07:19:11.000Z (2 months ago)
- Last Synced: 2025-04-14T12:47:43.742Z (2 months ago)
- Language: TypeScript
- Size: 134 KB
- Stars: 106
- Watchers: 54
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Voice Agents SDK Sample App
[](LICENSE)


This repository contains a sample app to highlight how to build [voice agents](https://platform.openai.com/docs/guides/voice-agents) using the [Agents SDK](https://openai.github.io/openai-agents-python) and Python. The backend is written using FastAPI and exposes a websocket endpoint. The front-end is written using Next.js and connects to the websocket server.
Features:
- Multi-turn conversation handling
- Push-to-talk audio mode
- Function calling
- Streaming responses & tool callsThis app is meant to be used as a starting point to build a conversational assistant that you can customize to your needs.
## Requirements
- OpenAI API key
- If you're new to the OpenAI API, [sign up for an account](https://platform.openai.com/signup).
- Follow the [Quickstart](https://platform.openai.com/docs/quickstart) to retrieve your API key.
- Node.js and npm
- `uv` installed on your system## How to use
1. **Set the OpenAI API key:**
2 options:
- Set the `OPENAI_API_KEY` environment variable [globally in your system](https://platform.openai.com/docs/libraries#create-and-export-an-api-key)
- Set the `OPENAI_API_KEY` environment variable in the project: Create a `.env` file at the root of the project and add the following line (see `.env.example` for reference):```bash
OPENAI_API_KEY=
```2. **Clone the Repository:**
```bash
git clone https://github.com/openai/openai-voice-agent-sdk-sample.git
cd openai-voice-agent-sdk-sample/
```3. **Install dependencies:**
You will have to install both the dependencies for the front-end and the server. To do this run in the project root:
```bash
make sync
```4. **Run the app:**
```bash
make serve
```The app will be available at [`http://localhost:3000`](http://localhost:3000).
## Contributing
You are welcome to open issues or submit PRs to improve this app, however, please note that we may not review all suggestions.
## License
This project is licensed under the MIT License. See the LICENSE file for details.