Skip to main content
The Realtime API can connect to phone calls through telephony providers like Twilio and Telnyx. The API natively supports G.711 μ-law (audio/pcmu) and A-law (audio/pcma) codecs at 8 kHz, so telephony audio can be forwarded without transcoding. Combined with built-in STT, LLM, and TTS stages plus barge-in support, you can stand up a voice agent on a phone number with relatively little glue code.

Twilio

Twilio is a cloud communications platform that provides programmable voice, messaging, and video APIs. With Twilio Media Streams, you can forward live call audio over a WebSocket to the Realtime API for processing. The example integration bridges a Twilio Media Stream to the Realtime API WebSocket, sending audio/pcmu frames in both directions. Since the Realtime API accepts G.711 μ-law natively, no transcoding is needed on the bridge. Twilio handles the phone number and call routing; the Realtime API handles everything else. To get started, see the Twilio integration example on GitHub.

Telnyx

Telnyx is a connectivity platform built on a private global IP network, offering carrier-grade voice, messaging, and networking APIs. Telnyx supports streaming call audio over a WebSocket, which plugs directly into the Realtime API. The example integration connects a Telnyx media stream to the Realtime API using the audio/pcmu format. Telnyx manages the phone number and SIP layer while the Realtime API runs the voice agent. To get started, see the Telnyx integration example on GitHub.