---
title: "How to Build a Voice AI Agent with OpenAI's GPT-Live, Twilio Agent Connect, and Python"
description: "This tutorial shows how to build a phone-based voice AI agent with OpenAI's GPT-Live, Twilio Agent Connect, and Python. It configures TAC's GPTLiveProvider to bridge Twilio Programmable Voice Media Streams to GPT-Live-1 in the OpenAI API, using 8kHz mu-law audio and avoiding custom WebSocket plumbing. The tutorial sets a proactive greeting, exposes a Python weather function through Responses delegation, and runs the function outside the real-time voice loop so a simulated three-second backend delay does not block the conversation. The resulting setup handles inbound calls through a Twilio webhook and outbound calls with an E.164 number, while the tutorial also notes per-call customization and alternative voice providers."
---

# How to Build a Voice AI Agent with OpenAI's GPT-Live, Twilio Agent Connect, and Python

[Twilio](https://yomu.fyi/company/twilio) · Xinghao Huang · Sep 10, 2026

**Type:** Tutorial

## Summary

This tutorial shows how to build a phone-based voice AI agent with OpenAI's GPT-Live, Twilio Agent Connect, and Python. It configures TAC's GPTLiveProvider to bridge Twilio Programmable Voice Media Streams to GPT-Live-1 in the OpenAI API, using 8kHz mu-law audio and avoiding custom WebSocket plumbing. The tutorial sets a proactive greeting, exposes a Python weather function through Responses delegation, and runs the function outside the real-time voice loop so a simulated three-second backend delay does not block the conversation. The resulting setup handles inbound calls through a Twilio webhook and outbound calls with an E.164 number, while the tutorial also notes per-call customization and alternative voice providers.

## Context

The tutorial addresses the problem of voice AI demos that work in testing scripts but fall apart when connected to real phone calls and production traffic.

## Approach / What changed

It uses Twilio Agent Connect's GPTLiveProvider with Twilio Programmable Voice Media Streams and GPT-Live-1, configures matching 8kHz mu-law audio, delegates tool decisions through the Responses API, and executes Python tools outside the real-time voice loop. A FastAPI server and Twilio webhook handle inbound calls, while the same VoiceChannel supports outbound calls.

## Takeaways

- GPT-Live is full-duplex and handles interruption logic; its audio format can be configured to match Twilio Media Streams' 8kHz mu-law wire format.
- Responses delegation lets a model decide when to call a tool while Twilio Agent Connect executes the registered Python function outside the real-time voice loop.
- The same GPTLiveProvider supports outbound calls through initiate\_outbound\_conversation, which requires the destination number in E.164 format.

**Tags:** [GPT-Live](https://yomu.fyi/topic/gpt-live), [Python](https://yomu.fyi/topic/python), [Twilio](https://yomu.fyi/topic/twilio)

- Source: [Twilio](https://www.twilio.com/en-us/blog/developers/tutorials/integrations/tac-gpt-live-voice-ai-agent-python)
- Source URL: https://www.twilio.com/en-us/blog/developers/tutorials/integrations/tac-gpt-live-voice-ai-agent-python
- Ingested by Yomu: 2026-09-11T04:02:47.053Z

[Read original post](https://www.twilio.com/en-us/blog/developers/tutorials/integrations/tac-gpt-live-voice-ai-agent-python)
