API Reference

Play3.0-mini

PlayHT's latest speech model for realtime use cases.

It's a lightweight, reliable and cost-efficient Multilingual Text-to-Speech model that supports voice cloning and TTS streaming through the API.

Use it in your code as follows:

import * as PlayHT from "playht";

// Initialize PlayHT API with your credentials
PlayHT.init({
  userId: "<YOUR_USER_ID>",
  apiKey: "<YOUR_API_KEY>",
});

PlayHT.stream("Hello from a realistic voice.", {voiceEngine: "Play3.0-mini"});
curl --request POST \
     --url https://api.play.ht/api/v2/tts/stream \
     --header 'X-USER-ID: <YOUR_USER_ID>' \
     --header 'AUTHORIZATION: <YOUR_API_KEY>' \
     --header 'accept: audio/mpeg' \
     --header 'content-type: application/json' \
     --data '
{
  "text": "Hello from a realistic voice.",
  "voice_engine": "Play3.0"
}
'

What's new with Play3.0-mini

  • Reduced hallucinations and Increased accuracy especially with numbers and alpha numeric sequences.
  • Better consistent latency of <200ms with streaming.
  • Uses a higher quality native 48kHz sampling instead of 24kHz by default.
  • Character limit per streaming request increased from 2k to 20k.
  • Supports 36 languages.

Read the full release post here: https://play.ht/news/introducing-play-3-0-mini/


Upgrading to Play3.0-mini

Python SDK

First upgrade the package:

pip install --upgrade pyht (should upgrade to 0.1.x)
When calling tts(), the voice_engine argument should be Play3.0-mini (this is also the default; pass PlayHT2.0 to use the 2.0 model).

Note that the new voice engine is Play3.0-mini, not PlayHT3.0

Play3.0-mini is multilingual! English is the default; to use a language other than English, pass a Language enum value (from pyht.client ) as the language argument to TTSOptions.


Node.js SDK

First upgrade the package: npm install playht@latest (should upgrade to 0.10.x)
When calling PlayHT.stream(), the voiceEngine argument should be Play3.0-mini.

Note that the new voice engine is Play3.0-mini, not PlayHT3.0.

Play3.0-mini is multilingual! English is the default; to use a language other than English, pass a language as the language argument on the options of PlayHT.stream().


PlayHT2.0-turbo

PlayHT's legacy voice model. Use it in your code as follows:

import * as PlayHT from "playht";

// Initialize PlayHT API with your credentials
PlayHT.init({
  userId: "<YOUR_USER_ID>",
  apiKey: "<YOUR_API_KEY>",
});

PlayHT.stream("Hello from a realistic voice.", {voiceEngine: "PlayHT2.0-turbo"});
curl --request POST \
     --url https://api.play.ht/api/v2/tts/stream \
     --header 'X-USER-ID: <YOUR_USER_ID>' \
     --header 'AUTHORIZATION: <YOUR_API_KEY>' \
     --header 'accept: audio/mpeg' \
     --header 'content-type: application/json' \
     --data '
{
  "text": "Hello from a realistic voice.",
  "voice_engine": "PlayHT2.0-turbo"
}
'