Hello @everyone / Deepgram team,
I'm integrating Twilio with Deepgram Voice Agent (Node.js/TS, Piehost) and hitting an issue: Deepgram Agent API closes immediately after receiving Settings with Code: 1005.
Setup: Twilio <-> My Server (proxy) <-> Deepgram Agent (wss://agent.deepgram.com/v1/agent/converse)
Confirmed & Tried:
- My server's Twilio WebSocket endpoint works (Twilio connects fine).
- Deepgram API key is valid: Works for
curltoapi.deepgram.com/v1/listen. - API Key Role: Using an 'Admin' role API key (see attached screenshot for options, selected highest permission).
- Deepgram connection
on('open')fires, andSettingsmessage is sent.
Settings Object (audio for Twilio):
{
"type": "Settings",
"audio": { "input": { "encoding": "mulaw", "sample_rate": 8000 }, "output": { "encoding": "mulaw", "sample_rate": 8000, "container": "none" } },
"agent": {
"speak": { "provider": { "type": "deepgram", "model": "aura-2-odysseus-en" } },
"think": { "provider": { "type": "open_ai", "model": "gpt-4o-mini" }, "prompt": "You are a helpful voice assistant..." },
"greeting": "Hello, how can I help you?"
}
}
Logs (after sending settings):
[56veir] ✅ Deepgram connected
[56veir] 📤 Sent Deepgram config
[56veir] ❌ Deepgram WebSocket closed. Code: 1005, Reason:
[56veir] ‼️ Deepgram connection closed with an error code: 1005. Check Deepgram docs for this code.
[56veir] 🔌 Twilio WebSocket closed. Code: 1011, Reason: