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.
Reference repos
Section titled “Reference repos”Prerequisites
Section titled “Prerequisites”- A Deepgram account with a real-time API key
- A Teler account with an active API key
- One Teler phone number on your account
- An ngrok auth token (for local development)
- Docker and Docker Compose
Configuration
Section titled “Configuration”| Variable | Required | Default | Description |
|---|---|---|---|
DEEPGRAM_API_KEY | yes | must be provided | Your Deepgram API key. |
TELER_API_KEY | yes | must be provided | Your Teler API key. |
NGROK_AUTHTOKEN | yes (local) | none | ngrok auth token. |
5-minute setup
Section titled “5-minute setup”git clone https://github.com/frejun-tech/teler-deepgram-bridgecd teler-deepgram-bridgecp .env.example .envdocker compose up -d --buildgit clone https://github.com/frejun-tech/teler-deepgram-node-bridgecd teler-deepgram-node-bridgecp .env.example .envdocker compose up -d --buildInitiate a call
Section titled “Initiate a call”curl -X POST https://your-domain/api/v1/calls/initiate-call \ -H "Content-Type: application/json" \ -d '{ "from_number": "+91XXXXXXXXXX", "to_number": "+91XXXXXXXXXX" }'Architecture
Section titled “Architecture”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:
- Caller audio in: raw audio frames from the Teler call are forwarded
to Deepgram as binary
Audiomessages. - 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. - Agent audio out: Deepgram streams synthesized audio back as binary
Audiomessages, which the bridge forwards to the Teler call.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Fix |
|---|---|---|
| Empty transcripts | Wrong sample rate or codec | Check Deepgram model expects 8 kHz linear PCM |
| 401 from Deepgram | Invalid DEEPGRAM_API_KEY | Rotate; check casing in .env |
| Bridge doesn’t speak back | Missing LLM or TTS in Deepgram config | Check your Deepgram Voice Agent is configured with an LLM and TTS provider in the Deepgram console |
Next steps
Section titled “Next steps” Pre-built voice agents If you don't want to build the full pipeline, use a realtime-model recipe.
WebSocket Messages The outbound audio messages you'll need to send TTS back.
Deepgram docs Real-time STT models and parameters.