POST
/
api
/
v1
/
tts
/
stream
curl --request POST \
  --url https://api.play.ai/api/v1/tts/stream \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-USER-ID: <api-key>' \
  --data '{
  "model": "Play3.0-mini",
  "text": "Country Mouse: Welcome to my humble home, cousin! Town Mouse: Thank you, cousin. It'\''s quite... peaceful here. Country Mouse: It is indeed. I hope you'\''re hungry. I'\''ve prepared a simple meal of beans, barley, and fresh roots. Town Mouse: Well, it'\''s... earthy. Do you eat this every day?",
  "voice": "s3://voice-cloning-zero-shot/baf1ef41-36b6-428c-9bdf-50ba54682bd8/original/manifest.json",
  "voice2": "s3://voice-cloning-zero-shot/baf1ef41-36b6-428c-9bdf-50ba54682bd8/original/manifest.json",
  "quality": "draft",
  "outputFormat": "mp3",
  "speed": 0.8,
  "sampleRate": 24000,
  "seed": 256,
  "temperature": 1.5,
  "voiceGuidance": null,
  "styleGuidance": null,
  "textGuidance": 1.25,
  "turnPrefix": "Country Mouse:",
  "turnPrefix2": "Town Mouse:",
  "prompt": "<string>",
  "prompt2": "<string>",
  "voiceConditioningSeconds": 20,
  "voiceConditioningSeconds2": 20,
  "language": "english"
}'
This response does not have an example.

Convert text to speech and receive audio bytes in real-time.

This endpoint supports two models:

  • Play 3.0 Mini: Our fast and efficient model for single-voice text-to-speech.
  • Dialog 1.0: Our flagship model with best quality and multi-turn dialogue capabilities.

We also offer Dialog 1.0 Turbo which is a faster version of Dialog 1.0 from a separate endpoint.

For more information, see Models.

Check out the How to use Dialog 1.0 Text-to-Speech API guide for a step-by-step approach to using the Dialog 1.0 API to convert text into natural human-like sounding audio.

Make sure to see the Create a Multi-Turn Scripted Conversation with the Dialog 1.0 API guide for examples on how to create a multi-turn scripted conversation between two distinct speakers.

Authorizations

Authorization
string
header
required

Your secret API key from PlayAI, formatted as Bearer YOUR_SECRET_API_KEY.

X-USER-ID
string
header
required

Your unique user ID from PlayAI.

Body

application/json

Response

200
audio/mpeg
A stream of audio bytes.

The response is of type file.