Skip to main content

Streaming Text-To-Speech V2

POST 

/v2/models/tts/stream

Stream audio synthesis from text using the V2 TTS model.

What does this endpoint do?

  • Converts text to speech in real-time using our advanced TTS model
  • Streams the audio back in chunks for faster playback start
  • Allows customization of voice characteristics through description
  • Supported speaker names: "Moussa", "Sekou", "Seydou"

Behavior Notes:

  • Audio is streamed in chunks of specified duration
  • First chunk may take longer as the model initializes
  • Output format is controlled by the format field

Headers:

  • x-api-key: Your API key for authentication

Parameters:

  • text (str): The text to convert to speech
  • description (str): Description of desired voice characteristics
  • chunk_size (float): Size of audio chunks in seconds (default: 1.0)
  • format (str): Output format — mp3 (default), wav, wav_8k, ulaw_8k

Example Request Body:

{
"text": "Aw ni ce, i ka kene wa?",
"description": "Moussa speaks with a very clear voice and a friendly tone",
"chunk_size": 1.0,
"format": "mp3"
}

Returns: StreamingResponse: A streaming response containing the encoded audio

Request

Responses

Successful Response