{
"generationId": "<string>",
"contextId": "<string>",
"items": "<string>",
"description": "<string>",
"voiceId": "<string>",
"text": "<string>",
"finalText": true,
"cancel": true,
"sampleRate": 123,
"addWordTimestamps": true
}{
"type": "<string>",
"generationId": "<string>"
}{
"type": "<string>",
"generationId": "<string>",
"error": "<string>"
}{
"type": "<string>",
"generationId": "<string>",
"audio": "<string>"
}No examples foundWebsocket TTS
Real-time text-to-speech streaming over websockets. Send text incrementally and receive audio chunks as they are generated. To authenticate, you must include an Authorization header, with the value Bearer {API_TOKEN}. You can also include an apiKey query param with the value being your API key. Websockets can run multiple TTS streams concurrently. If you’re using the contextId feature, make sure all generations for the context are on the same websocket.
{
"generationId": "<string>",
"contextId": "<string>",
"items": "<string>",
"description": "<string>",
"voiceId": "<string>",
"text": "<string>",
"finalText": true,
"cancel": true,
"sampleRate": 123,
"addWordTimestamps": true
}{
"type": "<string>",
"generationId": "<string>"
}{
"type": "<string>",
"generationId": "<string>",
"error": "<string>"
}{
"type": "<string>",
"generationId": "<string>",
"audio": "<string>"
}No examples foundInput message for text-to-speech generation
Message sent when text-to-speech generation is complete
Message sent when text-to-speech generation encounters an error
Message sent with audio data chunks during text-to-speech generation
Message sent with timestamps during text-to-speech generation, only when add word timestamps is true