TTS API

Add real-time text-to-speech to your app with Telnyx TTS API

Learn how to build real-time Text-to-Speech (TTS) Voice AI using Telnyx’s TTS websocket API. This step-by-step walkthrough demonstrates how to set up and run the a Python TTS WebSocket client.

Real-time text-to-speech lets your app speak instantly and naturally. Whether you’re building virtual assistants, AI phone agents, or support tools, generating lifelike speech in the moment creates a more human experience. But to sound natural, it needs to be fast.



That’s where Telnyx comes in. Telnyx TTS API streams high-quality natural-sounding speech the moment you generate it. You can access Telnyx NaturalHD, Natural, KokoroTTS, and Qwen3TTS over the public WebSocket path, choose provider-routed options where supported, customize tone and language, and deliver low-latency audio at scale. Telnyx Ultra remains the default recommendation for Telnyx-native Voice AI, but it is not the default for this public WebSocket tutorial.



👉 Watch the demo to see how to build a real-time voice AI experience using our Python WebSocket client.



<iframe src="https://player.vimeo.com/video/1140855073?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share" referrerpolicy="strict-origin-when-cross-origin" style="[object Object]" title="Convert text to speech in REAL TIME | Python | TTS websocket streaming">

<script src="https://player.vimeo.com/api/player.js">



What is in the demo




This key differentiator opens the door for seamless integrations with AI platforms and custom Text-to-Speech engines, allowing developers to build next-level voice experiences. Imagine creating real-time, responsive interactions that feel as natural as talking to a friend.

David Casem, CEO @ Telnyx


In this step-by-step video, we walk through how to generate HD-quality speech with low latency using Telnyx’s TTS API. You’ll go from setup to streaming audio in just a few minutes. Here’s what we cover:

  • How real-time TTS works over WebSockets
  • How to generate low-latency AI voices over WebSocket
  • How to install and run the Telnyx asyncio Python example
  • How to handle streaming audio chunks in real time
  • How to integrate standalone TTS into Voice AI agents
  • How to modify voice, speed, and output format settings


To follow along, you just need:

  • A Telnyx account
  • Your API key from the Telnyx portal
  • Python 3.8+


Developer resources

Start building with TTS today. Want help with your specific use case? <a href="/contact-us" style="color:#0047FF; text-decoration:underline;">Talk to us</a>.

Building with text to speech in Python? Join our subreddit.

Share on Social
Deniz Yakışıklı

Sr. Product Marketing Manager

Sign up for emails of our latest articles and news