This is a real-time demo app that lets you run functions in your browser using your voice.
It's powered by OpenAI's Realtime API over WebRTC, runs on Cloudflare Workers, and uses Replicate models to generate images.
Check out the guide to running this app: replicate.com/docs/guides/openai-realtime
Here's what you'll need to build this project:
- An OpenAI account. No special plan is required to use the Realtime API Beta.
- A Cloudflare account. You can sign up and run workers for free.
- A Replicate account.
- Node.js 20 or later.
- Git for cloning the project from GitHub.
- Create a Replicate API token at replicate.com/account/api-tokens
- Create an OpenAI API key at platform.openai.com/api-keys
Copy .dev.vars.example to .dev.vars
:
cp .dev.vars.example .dev.vars
Edit .dev.vars
and add your OpenAI API key and Replicate API token:
OPENAI_API_KEY=...
REPLICATE_API_TOKEN=...
Install dependencies
npm install
Run local server
npm run dev
Upload your secrets
npx wrangler secret put OPENAI_API_KEY
npx wrangler secret put REPLICATE_API_TOKEN
npm run deploy