busy-lunch-15701
10/07/2025, 7:49 AMraise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 403, message='Invalid response status', url='wss://api.elevenlabs.io/v1/text-to-speech/***********/multi-stream-input?model_id=eleven_v3&output_format=mp3_22050_32&enable_ssml_parsing=false&inactivity_timeout=180&apply_text_normalization=auto&sync_alignment=true&auto_mode=true'tall-airline-16756
10/07/2025, 7:49 AMtall-airline-16756
10/07/2025, 7:49 AMbusy-lunch-15701
10/07/2025, 7:57 AMreturn elevenlabs.TTS(
api_key=os.getenv("ELEVENLABS_API_KEY"),
voice_id=params.get("voice_id", NOT_GIVEN),
model=config.model or NOT_GIVEN,
# voice_settings=NOT_GIVEN,
)
1. usign api key and api key permission is finetall-airline-16756
10/07/2025, 7:58 AMaiohttp.client_exceptions.WSServerHandshakeError: 403. This usually happens because of a few common reasons, so let’s walk through them together:
• API Key Configuration: Please make sure your API key is correctly included in the headers with the exact key xi-api-key. Even if your key is valid, it’s important that it’s properly set in your environment or explicitly passed in your code.
• Header Formatting: It’s a good idea to double-check that the header name and formatting are spot on. Sometimes even a small difference can cause the server to reject the request.
• Endpoint URL: Take a moment to verify that the WebSocket endpoint URL is correctly formed, including the voice ID and model parameters.
• Account Restrictions: Also, please confirm that your ElevenLabs account supports WebSocket streaming, as some features might be limited depending on your account tier.
Here’s what I recommend to get this sorted:
1. Make sure the ELEVEN_API_KEY is properly set in your environment or explicitly passed in your code.
2. Verify that the xi-api-key header is included and formatted correctly.
3. Check that the voice ID and model parameters are accurate.
4. Confirm with ElevenLabs that your account tier supports WebSocket streaming.
If you’ve gone through these steps and are still facing the issue, please don’t hesitate to reach out. I’m here to help you troubleshoot further and get things working smoothly!
Sources: agents/src/inference/tts.ts | livekit-plugins/livekit-plugins-resemble/README.md