creamy-tiger-14805
12/29/2025, 8:58 AMtall-airline-16756
12/29/2025, 8:58 AMtall-airline-16756
12/29/2025, 8:59 AMcreamy-tiger-14805
12/29/2025, 8:59 AM2025-12-29 14:27:17,481 - DEBUG livekit.agents - using transcript io: `AgentSession` -> `TranscriptSynchronizer` -> `RoomIO` {"room": "playground-vMlg-a4p6", "pid": 90954, "job_id": "AJ_chXNWxXLrenp"}
2025-12-29 14:27:18,263 - ERROR livekit.agents - AgentSession is closing due to unrecoverable error
Traceback (most recent call last):
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/stt/stt.py", line 289, in _main_task
return await self._run()
^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/plugins/deepgram/stt.py", line 517, in _run
ws = await self._connect_ws()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/plugins/deepgram/stt.py", line 581, in _connect_ws
ws = await asyncio.wait_for(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/.pyenv/versions/3.12.3/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/aiohttp/client.py", line 1084, in _ws_connect
raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 402, message='Invalid response status', url='<wss://api.deepgram.com/v1/listen?model=nova-3&punctuate=true&smart_format=true&no_delay=true&interim_results=true&encoding=linear16&vad_events=true&sample_rate=16000&channels=1&endpointing=25&filler_words=true&profanity_filter=false&numerals=false&mip_opt_out=false&language=en-IN>' {"room": "playground-vMlg-a4p6", "pid": 90954, "job_id": "AJ_chXNWxXLrenp"}
2025-12-29 14:27:18,275 - ERROR livekit.agents - Error in _stt_task
Traceback (most recent call last):
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/stt/stt.py", line 408, in __anext__
val = await self._event_aiter.__anext__()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopAsyncIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs
return await fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/voice/audio_recognition.py", line 578, in _stt_task
async for ev in node:
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/voice/agent.py", line 376, in stt_node
async for event in stream:
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/stt/stt.py", line 411, in __anext__
raise exc # noqa: B904
^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/agents/stt/stt.py", line 289, in _main_task
return await self._run()
^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/plugins/deepgram/stt.py", line 517, in _run
ws = await self._connect_ws()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/livekit/plugins/deepgram/stt.py", line 581, in _connect_ws
ws = await asyncio.wait_for(
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/subhamdas/.pyenv/versions/3.12.3/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
return await fut
^^^^^^^^^
File "/Users/subhamdas/self-nm/agent-starter-python/.venv/lib/python3.12/site-packages/aiohttp/client.py", line 1084, in _ws_connect
raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 402, message='Invalid response status', url='<wss://api.deepgram.com/v1/listen?model=nova-3&punctuate=true&smart_format=true&no_delay=true&interim_results=true&encoding=linear16&vad_events=true&sample_rate=16000&channels=1&endpointing=25&filler_words=true&profanity_filter=false&numerals=false&mip_opt_out=false&language=en-IN>' {"room": "playground-vMlg-a4p6", "pid": 90954, "job_id": "AJ_chXNWxXLrenp"}
2025-12-29 14:27:18,280 - DEBUG livekit.agents - input stream detachedtall-airline-16756
12/29/2025, 8:59 AMWSServerHandshakeError: 402) that caused the agent to close. This error means Deepgram rejected the connection with HTTP 402 (Payment Required), not an authentication or network failure.
What you can do next:
• Log into your Deepgram Console (https://console.deepgram.com/) and check Billing & Payment Method, account balance, and that your project plan supports the nova-3 model and the advanced flags you’re using (smart_format, filler_words, etc.).
• Confirm your DEEPGRAM_API_KEY is set and that the key has streaming/STT permissions.
• Test the WS endpoint directly to reproduce the handshake and confirm 402:
◦ Example with wscat:
wscat -H "Authorization: Token YOUR_DEEPGRAM_KEY" -c "wss://api.deepgram.com/v1/listen?model=nova-3&language=en-IN&punctuate=true&smart_format=true"
• As a quick diagnostic, try a simplified request (disable advanced flags and/or use language=en) to see if it connects. If simplified requests succeed, re-enable features incrementally to identify which one triggers billing enforcement.
• Check Deepgram status: https://status.deepgram.com/
If you want, share:
• Whether your Deepgram account shows unpaid invoices, low balance, or a trial limitation.
• The exact value of the features you’re enabling (copy of the query string is fine).
I can then suggest the next specific steps (billing checks vs. config changes).
Sources: Deepgram STT plugin guide | LiveKit docscreamy-tiger-14805
12/29/2025, 9:05 AMtall-airline-16756
12/29/2025, 9:05 AMlk) or manually (docker, k8s, systemd)?
• Which secret(s) do you want to update (e.g., DEEPGRAM_API_KEY, OPENAI_API_KEY)?
• Do you prefer to pass secrets inline, from a .env file, or mounted as files?
Once you tell me those, I’ll give the exact lk command or the alternate steps to update and restart your agent.
Sources: Agents (Python) | livekit/livekit_composite | DeepWiki | Agent Builder | LiveKit docs