I’m seeing a 429 error possibly due to going over ...
# ask-ai
m
I’m seeing a 429 error possibly due to going over the concurrent TTS limit of 5 (I had 7 at some point while in development), is there a certain time after which the rate limit ban is lifted on my account?
t
Thanks for reaching out, Sagar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — regarding the 429 when you exceed concurrent TTS: that’s not a timed “ban.” The concurrency limit is enforced in real time and is lifted as soon as your number of active TTS connections falls below the limit (5 on the free Build plan). There’s no fixed wait time — end or close sessions to free slots and new requests will succeed immediately once concurrency is under the limit. Would you like tips to track or ensure sessions close cleanly during development? Sources: Quotas and limits | LiveKit docs
m
Can you reset my projects concurrent TTS connections? I tried to kill all processes and restart the agent but saw the same issue again
t
I can help — to reset concurrency you don’t need us to perform a manual reset. The concurrent TTS limit is lifted automatically as soon as your active TTS connections drop below the limit. Since restarting the agent didn’t help, let’s verify what’s still holding slots open. Please provide: • Your Project ID (or the project name) • The Room ID(s) where the TTS agents are running • How you’re starting the TTS sessions (SDK, agent process, container, etc.) • A timestamp (approx) when you restarted the agent and any logs showing session termination or 429 responses While you gather that, try: • Ensuring your agent explicitly closes TTS sessions with the SDK/agent shutdown path (call the proper disconnect/stop routine). • Checking for orphaned processes or containers on the host that might still hold sockets open. • Confirming no other machines or CI jobs are starting TTS sessions concurrently. Send the Project ID, Room ID(s), start method, and a sample log snippet and I’ll help pinpoint what’s still active and next steps to free the slots.
m
project ID: p_7h1o56ko25a room ID:
RM_4aGH3W3h8FZV
How TTS sessions are started: • SDK: LiveKit Python Agents SDK (
livekit-agents
version 1.3.6) • Agent process: Running locally via
uv run python src/agent.py dev
• Environment: macOS (not containerized, running directly) • TTS Configuration: Using
inference.TTS(model="cartesia/sonic-3")
through LiveKit Inference Gateway • Agent settings: ◦
preemptive_generation=True
(recently changed to
False
) ◦
use_tts_aligned_transcript=True
Timestamps and 429 responses: Latest restart attempt: December 10, 2025 at 00:22 AM EST • Room ID:
RM_4aGH3W3h8FZV
• Room Name:
room-m5rKC
• Job ID:
AJ_MmM2vD5rQURx
429 Error logs:
Copy code
WSServerHandshakeError: 429, message='Invalid response status', 
url='wss://agent-gateway.livekit.cloud/v1/stt'

WSServerHandshakeError: 429, message='Invalid response status', 
url='wss://agent-gateway.livekit.cloud/v1/tts'
Previous attempts with same errors: • 22:53 PM EST (Dec 9) • 22:07 PM EST (Dec 9) • 21:56 PM EST (Dec 9) Additional context: • Dashboard shows concurrent TTS limit: 5, peak usage: 7 • All local processes have been killed (
pkill -f "python src/agent.py"
) • No deployed instances running • 429 errors persist for 2+ hours despite clean restarts
t
Thanks — I’m responding to the persistent 429s for TTS on project
p_7h1o56ko25a
/ room
RM_4aGH3W3h8FZV
. Quick facts: the concurrent TTS limit is lifted automatically when active TTS connections fall below the limit (5). There’s no fixed cooldown — new requests succeed immediately once slots are free. Next diagnostic steps to find what's still holding slots open: 1. Confirm active participants in the room • Do you see any participants in
room-m5rKC
on the dashboard right now? If you can, list participant IDs you see. 1. Check for orphaned WebSocket connections locally • Run: ps or lsof to ensure no leftover python or websocket processes hold sockets (e.g.,
lsof -iTCP -sTCP:ESTABLISHED | grep python
). • On macOS, also check
netstat -anv | grep ESTABLISHED
for any lingering agent connections. 1. Verify agent shutdown path is closing TTS sessions • Ensure your agent code calls the SDK disconnect/stop routines that close TTS streams when you terminate (confirm the shutdown handler runs). • Since you used
pkill -f
, that can leave sockets open until OS cleans them; try a full machine restart if possible to ensure everything is closed. 1. Confirm no other machines/CI are creating sessions • Double-check CI jobs, other developer machines, or test scripts that might have started agents earlier. 1. Gather evidence if slots still show used • From the agent logs, share any participant connect/disconnect entries around your restart at Dec 10 00:22 AM EST and the Job ID
AJ_MmM2vD5rQURx
. • From the dashboard, a screenshot or exact participant list and timestamps of peak 7 concurrent TTS would help. Tell me which checks you’ve already run (dashboard participant list, lsof/netstat results, and whether you can reboot the machine). If after those checks the slots still appear occupied, share the participant IDs or the relevant log snippets and I’ll help pinpoint the remaining active sessions.
m
Rebooted machine at ~00:45 AM EST, all local processes killed. Still getting 429 errors immediately on new connections. Latest attempt at 00:47 AM with Room ID
RM_TKo9xP5mdzrU
. The concurrent TTS connections appear stuck on your gateway - can you manually reset them?”
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
m
is there a way I can resolve dangling websocket connections?