Text-to-Speech
Text to Speech Stream
Stream text to speech with real-time audio chunks
POST
Request
Headers
string
required
Bearer token with your API key
string
required
application/json
Body
string
required
The text to convert to speech (max 5000 characters)
string
ID of the voice to use
boolean
default:"true"
Enable audio enhancement
number
default:"1.0"
Speech speed (0.5 to 2.0)
Response
The response is streamed as newline-delimited JSON (NDJSON). Each line contains a JSON object:Chunk Object
string
Type of message: “chunk”, “complete”, or “error”
object
Contains the audio chunk data
string
Base64-encoded audio chunk
string
Error message (only for error type)
Use Cases
Streaming is ideal for:- Real-time applications: Voice assistants, chatbots
- Long-form content: Articles, books, documents
- Low latency: Start playing audio before generation completes
- Progressive enhancement: Display text while generating audio