Template for deploying an AI voice assistant with Twilio, OpenAI Realtime API, and Cloudflare Workers
View the Project on GitHub jmoore2333/twilio-openai-voice-assistant-cloudflare-template
This template keeps behavior in a few small places so it is easy to tune without rewriting the app. This can involve a good amount of trial and error, tuning RealTime prompts is something you’ll want to review the OpenAI prompting guide to better understand in general. As a note, the mini model is much less consistent with function handling.
Edit src/prompts.ts when you want to change:
Edit src/realtime-bridge.ts when you want to change the exact opening the model says on the first turn.
That first response.create instruction is usually the strongest lever for stabilizing the opening.
The runtime values below come from wrangler.toml or .dev.vars:
BUSINESS_NAMEWELCOME_ENGLISHWELCOME_SPANISHREALTIME_MODELIf you want different copy per environment, keep the prompt generic and override the greetings with environment values.
The live tool is save_call_intake in src/prompts.ts.
If you add a field:
src/prompts.tssrc/types.tssrc/db.tssrc/email.ts if the new field should appear in the summary