Compose Text To Speech
Generate multiple speech segments and pauses as one audio file. Add tts and pause objects to segments in the order they should appear. Each tts segment accepts the same voice, model, prompt, and output settings as POST /v1/text-to-speech; voices and models may differ between segments.
Limits
- Up to 50 total segments, with at least one
ttssegment - Up to 2,000 characters across all
ttssegments - Up to 10 seconds per pause and 60 seconds across all pauses
- All
ttssegments must use the sameaudio_format
Credits are charged only for the combined text length; pauses are free. Segments are synthesized in parallel and returned in input order. If any segment fails, the entire request fails and no credits are charged.
Response
A successful request returns the composed audio directly as binary data, not JSON. The response Content-Type is audio/wav or audio/mpeg, based on the audio_format requested by the segments.
Authorizations
X-API-KEYstringheaderrequiredAPI key for authentication. You can obtain an API key from the Typecast API Console.
A sequence of speech and pause segments returned as one audio file.
segmentsobject[]requiredSpeech and pause segments in output order. Provide 1–50 segments with at least one tts segment.