Skip to content
API reference

Streaming text to speech

Start playing before the whole text is spoken.


POST

/v1/text-to-speech/stream

The same body as /v1/text-to-speech, with output_format mp3, mulaw or alaw, and up to 10,000 characters. The text is split into sentences (the first kept short) and the audio is sent as each one is ready, so playback can start after one short sentence. x-first-audio-ms says how long the first piece took.

A bad request or a provider failure before the first audio gets a normal error status. A failure later ends the stream early.

curl -N -X POST https://lipivo.com/v1/text-to-speech/stream \
  -H "x-api-key: $LIPIVO_API_KEY" -H "content-type: application/json" \
  -d '{"text": "...a long reply...", "language_code": "en-IN"}' -o reply.mp3