average-knife-77348
11/19/2025, 7:58 PMtall-airline-16756
11/20/2025, 12:39 PMlivekit.plugins.elevenlabs. Let's work through this together to get it resolved. Here are some helpful steps you can follow:
1. Check API Key: First, please double-check that your ELEVEN_API_KEY environment variable or apiKey parameter is set correctly. Sometimes, a missing or incorrect key can cause connection hiccups.
2. Inspect WebSocket Closures: This error usually means the connection closed unexpectedly. It’s a good idea to see if the remote server disconnected abruptly or if there might be any network interruptions on your end.
3. Review Retry Logic: The plugin will try to reconnect up to three times by default. Take a look at your logs for any retry warnings or ongoing connectivity issues that might give us more clues.
4. Common Causes:
◦ Network issues: You can use the LiveKit Connection Test utility to check how your WebSocket and TURN server connections are doing.
◦ Authentication failure: Make sure your API key is still valid and hasn’t expired.
◦ Server-side timeouts: Sometimes, if no text is sent for a while (default is 300 seconds), the connection might close due to inactivity.
1. Enable Debug Logs: Turning on debug or warning-level logs for livekit.plugins.elevenlabs can provide more detailed error messages and show how retries are happening.
2. Unexpected Message Types: Keep an eye out for any warnings about non-text messages, as these might indicate unusual protocol behavior.
It’s really helpful to review the logs starting from when the connection first attempts through to the failure point to spot any specific errors. If things still aren’t working, running some network diagnostics to ensure a stable WebSocket connection to wss://api.elevenlabs.io can make a big difference.
Sources: plugins/cartesia/src/tts.ts | livekit-plugins/livekit-plugins-elevenlabs/README.md | Diagnosing Connection Errors with Connection Test Utility