Messages
{
"voice_id": "ryan",
"text": "Hello, this is a sample text to convert to speech.",
"max_buffer_flush_ms": 0,
"continue": false,
"flush": false,
"language": "en",
"sample_rate": 24000,
"speed": 1,
"consistency": 0.5,
"enhancement": 1,
"similarity": 0
}{
"request_id": "<string>",
"status": "<string>",
"data": {
"audio": "<string>"
}
}Lightning v2
Text to Speech (WebSocket)
The Lightning v2 WebSocket API provides real-time text-to-speech streaming capabilities with high-quality voice synthesis. This API uses WebSocket to deliver audio chunks as they’re generated, enabling low-latency audio playback without waiting for the entire audio file to process. For an end-to-end example of how to use the Lightning v2 WebSocket API, check out Text to Speech (WS) Example
WSS
/
api
/
v1
/
lightning-v2
/
get_speech
/
stream
Messages
{
"voice_id": "ryan",
"text": "Hello, this is a sample text to convert to speech.",
"max_buffer_flush_ms": 0,
"continue": false,
"flush": false,
"language": "en",
"sample_rate": 24000,
"speed": 1,
"consistency": 0.5,
"enhancement": 1,
"similarity": 0
}{
"request_id": "<string>",
"status": "<string>",
"data": {
"audio": "<string>"
}
}bearerAuth
type:http
Bearer token authentication
TTSRequest
type:object
TTSResponse
type:object

