{
"event": "start",
"request": {
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
}{
"event": "text",
"text": "Hello from Fish Audio."
}{
"event": "flush"
}{
"event": "stop"
}{
"event": "audio",
"audio": "<binary>"
}{
"event": "finish",
"reason": "stop"
}{
"event": "error",
"error": "Synthesis failed"
}Fish TTS S2.1 Pro (WebSocket)
Stream speech synthesis from SLNG-hosted Fish TTS 2.1 Pro over a native MessagePack WebSocket. Open the session with a start frame carrying voice and audio settings, send text frames as input arrives, then flush or stop to finish; the server streams back binary audio chunks and a finish frame when synthesis completes.
{
"event": "start",
"request": {
"reference_id": "9a9cf47702da476aa4629e2506d4a857",
"format": "mp3"
}
}{
"event": "text",
"text": "Hello from Fish Audio."
}{
"event": "flush"
}{
"event": "stop"
}{
"event": "audio",
"audio": "<binary>"
}{
"event": "finish",
"reason": "stop"
}{
"event": "error",
"error": "Synthesis failed"
}API key issued by SLNG. Pass as Authorization: Bearer <token> in the WebSocket upgrade request headers.
GET
Open a Fish Audio synthesis session with voice and audio configuration.
Append text to synthesize on the active session.
Force synthesis of buffered text without ending the session.
End input; the server finishes synthesis and closes the session.
Streamed binary audio chunk from Fish Audio.
End-of-synthesis signal for the session.
Error frame from the provider.