Inference STT WebSocket fails (APIConnectionError) while room connection works

We’re using @livekit/agents (Node) for a self-hosted agent.

Room connection works fine:

  • worker registers successfully
  • ctx.connect() succeeds
  • participant joins successfully

However, any AgentSession using inference.STT fails right after session start.

Error:
APIConnectionError: Error connecting to LiveKit WebSocket
→ retries 3 times
→ then: failed to recognize speech after 4 attempts

This happens with both:

  • deepgram/nova-3
  • assemblyai/u3-rt-pro

If we remove STT completely:
→ session works normally

We also verified:

  • DNS resolution for agent-gateway.livekit.cloud works
  • HTTPS to https://agent-gateway.livekit.cloud returns 200
  • wscat to wss://agent-gateway.livekit.cloud/v1 returns 401 (expected)

So network/TLS/websocket reachability seems fine.

This looks specific to inference STT websocket/auth path.

Environment:

  • @livekit/agents: 1.0.50 (latest)
  • Node: 20
  • Region: Australia
  • Self-hosted agent

Minimal repro:

```ts
const session = new voice.AgentSession({
stt: new inference.STT({
model: ‘deepgram/nova-3’,
language: ‘en’,
}),
});

await session.start({
room: ctx.room,
agent: new voice.Agent({
instructions: ‘Transcribe only.’,
}),
});

Screenshot 2026-03-26 at 10.33.21

It seems you have exceeded your free tier limits, you should see this when you log into your project at cloud.livekit.io :up_arrow:

You should have received an email about this also, it looks as though you have exceeded the STT connection limit, Pricing | LiveKit