WebSocket improvements: reliability & custom timeout

More stable output for long audio generations & custom inactivity timeout

We’ve made updates to our WebSocket API that make long audio generations more stable. These changes fix issues where voices could become robotic or fade during longer sessions, ensuring consistent quality throughout. Below, we've shared how a voice changes between the beginning and end of a long generation:

Before

 / 
 / 

After

 / 
 / 

We've also added a custom inactivity timeout for WebSocket connections, with a new maximum of 180 seconds. The default remains at 20 seconds but can be extended to better suit your needs.

To adjust this, simply add inactivity_timeout as a query parameter in the WebSocket endpoint:

wss://api.elevenlabs.io/v1/text-to-speech/{voice_id}/stream-input?model_id=eleven_turbo_v2&inactivity_timeout=180

Explore more

ElevenLabs

Create with the highest quality AI Audio

Get started free

Already have an account? Log in