Deepgram
Deepgram is a streaming speech-to-text provider. This bridge wires Teler call audio to Deepgram’s real-time API; the transcript flows back into your application logic.
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 | none | Your Deepgram API key. |
TELER_API_KEY | yes | none | 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 http://localhost:8000/api/v1/calls/initiate-call \ -H "Content-Type: application/json" \ -d '{ "from_number": "+91XXXXXXXXXX", "to_number": "+91XXXXXXXXXX" }'How it works
Section titled “How it works”The bridge opens a WebSocket to Deepgram’s real-time STT endpoint and pipes caller audio in. Transcripts come back as they’re produced, typically every few hundred milliseconds.
To build a full agent on top of Deepgram, fork this repo and add:
- An LLM: call OpenAI, Anthropic, or your model with the transcript.
- A TTS, such as Cartesia, ElevenLabs, or OpenAI, to produce audio.
- Send the TTS audio back to Teler over the same WebSocket using the
outbound
audiomessage type.
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 | This is STT only | You must add LLM + TTS in your fork |
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.