Text to Speech API for Python

Unleash the power of real-time voice synthesis in your applications with our simple-to-use Text to SpeechPython API. Deliver exceptional user experiences with low latency, lifelike AI voices using our advanced AI models.

Generate spoken audio from input text
from pyht import Client
from dotenv import load_dotenv
from pyht.client import TTSOptions
import os
load_dotenv()

client = Client(
    user_id=os.getenv("PLAY_HT_USER_ID"),
    api_key=os.getenv("PLAY_HT_API_KEY"),
)
options = TTSOptions(voice="s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json")
for chunk in client.tts("Can you tell me your account email or, ah your phone number?", options):
    # do something with the audio chunk
    print(type(chunk))"
    )

    response.stream_to_file(speech_file_path)

Trusted by individuals and teams of all sizes

brands
brands
brands
brands
brands
brands

Best AI Voices, Lowest Latency, Python API for Text to Speech in Your Applications

Choose from a vast selection of over 900 lifelike generative and neural AI voices. Provide your users with a seamless, multilingual voice experience in real time, featuring support for 142 languages and native accents.

Conversational Voices

Perfect for entertainment videos, podcasts and audiobooks

Narrative Voices

Ideal for audiobooks, explainer videos and documentary videos

Explainer Voices

Ideal for entertainment videos, explainer videos, podcasts and audiobooks

Children Voices

Perfect for audiobooks, explainer videos and e-learning

Local Accents

Localize your entertainment videos, adverts and audiobooks

Emotions

Ideal for gaming, creative videos and ads

Character Voices

Perfect for gaming, creative videos and ads

Training Voices

Suitable for training videos, L&D and E-learning

Access 140+ Languages and Accents with the Lowest Latency Python Text to Speech Voice API

Offer multilingual voice experiences to your users in real time with our voices in 142 languages and accents. Create localized speech content in almost every language using our Python API.

PlayHT Offers the Best Text to Speech Python API

Our natural sounding voices with local and regional accents are trained on our own models. Get access to these unique, high quality voices via our very low latency text to speech Python API. No matter the project, the character, or the situation, you’re sure to find the perfect voice.

Optionally, unlock access to other top providers to manage multiple AI voices via a single API. Also, check out our text to speech JavaScript API.

Real-time latency

PlayHT's new Turbo voice models can generate speech in <300ms.

Low maintenance

As you’ll be using a single text to speech API, you just have one integration to maintain.

Automatic updates

We make sure you’re always up to date with all the improvements made by the TTS providers.

Latest voices

All the latest voices added by the TTS providers are synced and ready for you to use.

Key Features

Leverage futuristic text to speech features to create the most realistic speech for your applications.

829 Voices across
142 Languages

Access a growing library of 829 high-quality male, female and kids voices in 142 languages.

Expressive Voice
Styles

Explore expressive voice styles such as narrative, conversational, cheerful, angry, sad and empathetic.

Manipulate Voice
Tones

Manipulate the volume, rate and pitch of words or even entire sentences to create unique voice effects.

Text and SSML
Support

Add pauses, numbers, date, time formatting, and other advanced, pronunciation instructions.

Integrate Simply, Scale Efficiently

Subscribe to a plan

The Python API is a premium feature and is available across all the subscription plans

Generate secret key

Go to your dashboard and acquire your unique secret key

Synthesize speech

Convert text to speech and start integrating in your applications

Frequently Asked Questions

What are the advantages of using Text to Speech?

What are the main ways to convert text to speech?

Does PlayHT offer free speech synthesis?

Are the AI voices realistic?

What customizations can I do with the AI voices?

What is a Python TTS API?

Is PlayHT’s text to speech Python API free?

What is the REST API for text to speech?

What is the best text to speech Python API?

Build Real-Time Voice Applications with PlayHT's Text to Speech Python API