Skip to main content
This example demonstrates how to create an agent that can process audio input and generate audio output using OpenAI’s GPT-4o audio preview model. The agent analyzes an audio recording and responds with both text and audio.

Code

audio_input_output.py

Usage

1

Set up your virtual environment

2

Install dependencies

3

Export your OpenAI API key

4

Run Agent