Skip to content

Deepgram

Deepgram’s Voice Agent API is a managed conversational pipeline. This bridge wires Teler call audio directly to Deepgram’s Voice Agent WebSocket; speech recognition, the LLM, and text-to-speech are all handled by Deepgram, with each component configurable, and audio flows back into the call automatically.

VariableRequiredDefaultDescription
DEEPGRAM_API_KEYyesmust be providedYour Deepgram API key.
TELER_API_KEYyesmust be providedYour Teler API key.
NGROK_AUTHTOKENyes (local)nonengrok auth token.
Terminal window
git clone https://github.com/frejun-tech/teler-deepgram-bridge
cd teler-deepgram-bridge
cp .env.example .env
docker compose up -d --build
Terminal window
curl -X POST https://your-domain/api/v1/calls/initiate-call \
-H "Content-Type: application/json" \
-d '{
"from_number": "+91XXXXXXXXXX",
"to_number": "+91XXXXXXXXXX"
}'

The bridge opens a WebSocket to Deepgram’s Voice Agent endpoint (wss://agent.deepgram.com/v1/agent/converse) and relays caller audio in both directions:

  1. Caller audio in: raw audio frames from the Teler call are forwarded to Deepgram as binary Audio messages.
  2. Deepgram runs the full pipeline internally: it transcribes the audio (listen), generates a response (think), and synthesizes speech (speak) — all inside the same WebSocket session.
  3. Agent audio out: Deepgram streams synthesized audio back as binary Audio messages, which the bridge forwards to the Teler call.
SymptomLikely causeFix
Empty transcriptsWrong sample rate or codecCheck Deepgram model expects 8 kHz linear PCM
401 from DeepgramInvalid DEEPGRAM_API_KEYRotate; check casing in .env
Bridge doesn’t speak backMissing LLM or TTS in Deepgram configCheck your Deepgram Voice Agent is configured with an LLM and TTS provider in the Deepgram console