Stream Audio From Text

Streams the audio bytes immediately or returns a URL that allows immediate streaming.

ℹ️

Turbo Streaming

For low latency turbo streaming, set voice_engine to PlayHT2.0-turbo and use a PlayHT 2.0 voice.
For more information, see supported voice models.

To ensure fair usage, this streaming endpoint is subject to more strict rate-limits and also limits the text size it may take as input. Input text provided to the streaming endpoint may contain at most 20 sentences. A sentence is defined as a sequence of at least 35 characters separated by a punctuation character (., ? or !). Maximum text length is 2000 characters.

The endpoint responds with a byte audio stream right away:

  • Status: 200 - OK
  • Body: audio bytes

If the accept header is application/json, the endpoint returns data containing an URL that is immediately streamable:

  • Status: 201 - CREATED
  • Body:
    {
      "href": "https://play.ht/api/v2/tts/f0gZrOKBKL7veJ6o1M;1KjbyModJp92iPdBp4;w92633zG2nrMalFlEg?format=audio-mpeg",
      "method": "GET",
      "contentType": "audio/mpeg",
      "rel": "item",
      "description": "URL for fetching the generated audio as a playable stream of bytes"
    }
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required
length ≤ 2000
Defaults to Hello from a realistic voice.

The text to be converted to speech.

string
required
Defaults to s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json

The unique ID for a PlayHT or Cloned Voice.

string
enum
Allowed:
string | null
enum
Defaults to mp3

The format for the output audio. Note that PlayHT1.0 engine voices and JSON output format only support 'mp3' and 'mulaw'.

Allowed:
number
0.1 to 5

Control how fast the generated audio should be. A number greater than 0 and less than or equal to 5.0

number
8000 to 48000

A number greater than or equal to 8000, and must be less than or equal to 48000

number | null
≥ 0

An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file.

number | null
0 to 2

A floating point number between 0, inclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice.

string | null
enum

The voice engine used to synthesize the voice.

Allowed:
string | null
enum

An emotion to be applied to the speech. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine.

number | null
1 to 6

A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices. Higher numbers will maximize its individuality. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine.

number | null
1 to 30

A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine.

number | null
1 to 2

A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text. Only supported when voice_engine is set to PlayHT2.0, and voice uses that engine.

Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
audio/mpeg
application/json