{
"type": "<string>",
"text": "<string>"
}{
"type": "<string>"
}{
"type": "<string>"
}{
"type": "<string>",
"sentence_index": 123,
"sentence_text": "<string>",
"format": "<string>",
"sample_rate": 123
}{
"type": "<string>",
"sentence_index": 123,
"total_bytes": 123,
"credits_utilized": 123
}{
"type": "<string>",
"total_sentences": 123
}{
"type": "<string>",
"code": 123,
"message": "<string>"
}TTS WebSocket
Bidirectional text-to-speech channel. Authenticate with the chariotai-api-key header, or with the api_key query parameter when your client cannot set handshake headers.
Binary frames carrying audio are interleaved between the audio.start and audio.done messages and are not modelled as JSON messages below.
The connection closes with code 1000 on success, 1008 on an auth or parameter problem, 1011 on an upstream failure, and 4402 when the workspace runs out of credits.
{
"type": "<string>",
"text": "<string>"
}{
"type": "<string>"
}{
"type": "<string>"
}{
"type": "<string>",
"sentence_index": 123,
"sentence_text": "<string>",
"format": "<string>",
"sample_rate": 123
}{
"type": "<string>",
"sentence_index": 123,
"total_bytes": 123,
"credits_utilized": 123
}{
"type": "<string>",
"total_sentences": 123
}{
"type": "<string>",
"code": 123,
"message": "<string>"
}GET
Add text to the server's buffer. Does not generate audio on its own.
Synthesize everything currently buffered and stream the audio back. The session stays open. Flushing is what triggers generation.
Signal that no more text is coming. The server flushes the remainder and finishes the session.
A new audio segment is about to stream as binary frames.
The current segment has finished streaming. Carries the credits charged for this segment.
All segments are complete. The server then closes the connection with code 1000.
An error occurred. Terminal errors carry a code matching the WebSocket close code that follows.