i keep getting 2025-11-10 16:30:10,445 - WARNING l...
# ask-ai
a
i keep getting 2025-11-10 163010,445 - WARNING livekit.plugins.elevenlabs - websocket closed unexpectedly {"pid": 42908, "job_id": "AJ_4mA7b92BrfrQ"} why is that?
t
Thanks for reaching out, Jaihee. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're encountering the warning "websocket closed unexpectedly" in
livekit.plugins.elevenlabs
. This message appears when the WebSocket connection to ElevenLabs' streaming TTS service ends before the synthesis finishes. It can happen for a few reasons, such as: • Network connectivity hiccups • API rate limits being reached or quota exceeded • Server timeouts or maintenance on ElevenLabs' side • Invalid API credentials • Connection inactivity timeout (usually set to 180 seconds by default) To help resolve this, you might try the following steps: 1. Double-check that your ElevenLabs API key is valid and properly set up. 2. If needed, you can increase the inactivity timeout—for example,
tts = elevenlabs.TTS(inactivity_timeout=300)
to give more time before disconnecting. 3. Take a look at your logs for any error messages from ElevenLabs that come before this warning; they often provide useful clues. 4. Make sure your implementation includes error handling and retry logic to gracefully manage temporary disconnections. If you continue to experience difficulties, you might find using LiveKit Inference for ElevenLabs TTS helpful, as it takes care of connection management and billing, making things a bit smoother. Sources: livekit-plugins/livekit-plugins-rtzr/livekit/plugins/rtzr/stt.py | plugins/resemble/src/tts.ts | ElevenLabs TTS plugin guide | LiveKit Docs
a
it used to work perfectely fine? !
t
Thanks for reaching out! Since this issue just started happening, could you please let me know if there have been any recent changes to your setup? For example, updates to your ElevenLabs API key, network settings, or plugin version. Also, if you’ve noticed any specific error messages in the logs before the WebSocket closes, sharing those would be really helpful. I’m here to help you get this sorted out!