Text-to-Speech (SSE)
Stream audio with extra metadata from a complete transcript
Authorizations
Headers
API version header.
2024-06-10 "2024-06-10"
Body
- TTSRequestIdSpecifier
- TTSRequestEmbeddingSpecifier
The language that the given voice should speak the transcript in.
en, fr, de, es, pt, zh, ja, hi, it, ko, nl, pl, ru, sv, tr This can be any string value you find useful. The server will echo back the same context_id in events that it sends.
Contexts on the TTS (WebSocket) endpoint are used for continuations. > The TTS (SSE) endpoint does not support continuations, so most users just ignore this property.
The maximum duration of the audio in seconds. You do not usually need to specify this. If the duration is not appropriate for the length of the transcript, the output audio may be truncated.
Whether to return word-level timestamps. If false (default), no word timestamps will be produced at all. If true, the server will return timestamp events containing word-level timing information.
Whether to return phoneme-level timestamps. If false (default), no phoneme timestamps will be produced - if add_timestamps is true, the produced timestamps will be word timestamps instead. If true, the server will return timestamp events containing phoneme-level timing information.
Whether to use normalized timestamps (True) or original timestamps (False).
Influences the speed of the generated speech. Faster speeds may reduce hallucination rate.
This feature is experimental and may not work for all voices.
slow, normal, fast Response
Server-sent events stream. Each frame is data: <json>\n\n where the JSON payload matches TTSSSEEvent.
- TTSSSEChunkEvent
- TTSSSETimestampsEvent
- TTSSSEPhonemeTimestampsEvent
- TTSSSEDoneEvent
- TTSSSEErrorEvent
Audio data chunk.
Event type identifier.
chunk Whether this is the final event for the request. Always false for chunk events.
false Base64-encoded audio data.
Server-side processing time for this chunk in milliseconds.
HTTP-style status code.
The context ID echoed back from the request, if one was provided.