AgentRecipes
Recipes › Voice & phone agents

How to place outbound reminder and callback calls with Twilio and OpenAI GPT-Live

Voice & phone agentsTwilio✓ Confirmed by source

Confirmed by source: Official Twilio tutorial with full code and documented call output. Checked live on 2026-10-25: tutorial and the companion inbound tutorial return 200; the code repo github.com/pkamp3/speech-assistant-openai-gpt-live-1-node exists (MIT) and both live-demo.js and outbound-demo.js pass a Node syntax check; OpenAI's model pages for gpt-live-1 and gpt-5.6-terra are live and neither is on OpenAI's deprecations page. Not run by BranoLabs (no real calls placed). (checked 2026-10-25)

The problem

Appointment reminders, delivery updates and promised callbacks are phone calls staff keep forgetting to make. You want a script that dials the customer, says who is calling and why, looks up the note for that callback in your own system and can answer follow-up questions, all in a natural voice that can be interrupted.

Tools needed

Step-by-step recipe

  1. Get a Twilio number with Voice, an OpenAI API key allowed to use gpt-live-1 and the delegation model, Node.js 22+ and a tunnel such as ngrok.
  2. Create a Node project (ES modules) and install fastify, @fastify/formbody, @fastify/websocket, ws, dotenv and twilio. Put OPENAI_API_KEY, TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, PHONE_NUMBER_FROM and DOMAIN in .env.
  3. Write two prompts: a voice prompt for the persona (it discloses it is an AI and is returning a call, and must not claim to know the reason until the lookup tool has answered) and a short backend prompt for the delegation model that says which tool to use.
  4. Define the tools: a function such as get_callback_reason that looks up the note for this call in your database (the tutorial uses a mock list), and optionally OpenAI's hosted web_search.
  5. Add a guard that only dials numbers you are allowed to call (the tutorial accepts Twilio numbers you own, verified caller IDs and an explicit allow-list), then place the call with client.calls.create and inline TwiML that connects a Media Stream to wss://DOMAIN/media-stream.
  6. In the /media-stream WebSocket route, open wss://api.openai.com/v1/live/sessions, wait for Twilio's streamSid, then send session.start with the model, voice prompt, audio/pcmu at 8000 Hz and Responses delegation with your tools.
  7. On session.started, make the agent speak your opening line verbatim; relay session.output_audio.delta to Twilio and Twilio media frames to session.input_audio.append; answer completed function_call items with your tool output and response.create; close both sockets when the call stops.
  8. Start the tunnel, set DOMAIN, run node outbound-demo.js --call=+E164NUMBER to your own phone, and test the greeting, the lookup, a web-search question and interruptions before wiring it to a real reminder list.

Copyable prompt

Prompt template
Voice prompt: You are [AGENT NAME], an AI assistant calling on behalf of [BUSINESS NAME]. Say in your first sentence that you are an AI assistant and that you are calling about [REMINDER TYPE, e.g. tomorrow's appointment]. Do not state any details of the reminder until get_reminder has returned. If the person asks to stop receiving calls, confirm politely and call mark_do_not_call. If they want to change something, offer [OPTIONS, e.g. confirm / reschedule via link / call-back from staff]. Keep it short; this is an unexpected call.
Backend prompt: Use get_reminder(customer_id=[CUSTOMER ID]) for the reminder details and [OTHER TOOL] for [PURPOSE]. Answer in one or two sentences.

Original template written by our AI agent for AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.

What the builder reported

Twilio's official tutorial, published alongside OpenAI's GPT-Live API, walks through the complete application and shows the expected terminal output of a working call: the outbound call SID, the GPT-Live session ID, a get_callback_reason tool call and the agent's spoken answer. The finished inbound and outbound code is published on GitHub under MIT.

These are the source author's own claims. AgentRecipes has not run this recipe itself.

Watch out for

Source

Original write-up: Twilio blog (2026-09-10) ↗

Found via Twilio blog: “Build Voice AI Experiences with Twilio and GPT-Live-1 in the OpenAI API”. This recipe summarises the source in words written by our AI agent; read the original for the full details. Link last checked 2026-10-25.

More voice & phone agents recipes

Set up an AI phone receptionist that books, reschedules and cancels appointments (Vapi)A small business such as a barbershop or clinic misses calls while staff are busy, and most of those calls are simple: book a slot, move…Vapi✓ Confirmed by sourceAnswer calls after hours with an ElevenLabs voice agent and get a summary of every call (Twilio)Calls that come in at night or at weekends go to a voicemail box nobody checks until the next morning, and the caller often never calls…ElevenLabs Agents✓ Confirmed by sourceLet an AI phone agent hand a caller to a human with a spoken summary (LiveKit warm transfer)A voice agent can handle routine calls, but some callers need a person: a complaint, an escalation or something the agent may not…LiveKit Agents✓ Confirmed by source

New agent recipes in your inbox

A short email with the newest automation recipes, each linked to its real-world source. No spam. Every email has a one-click unsubscribe link.