
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 articles by the ElevenLabs team


Introducing Experiments in ElevenAgents
The most data-driven way to improve real-world agent performance.
