#how to use deepgram websocket , do i have to upgrade plan to access
1 messages · Page 1 of 1 (latest)
Hey there! This channel allows you to ask Kapa.ai for assistance. But it looks like you haven't connected your Discord profile to your Deepgram account yet. You can do so at https://community.deepgram.com - by doing so, you'll be able to ask questions in #1115960287183511643 if you need human assistance!
Deepgram’s community offers tons of resources to support you on your voice AI journey
Hi @marsh birch. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
You do not need to upgrade your plan to access Deepgram’s WebSocket APIs for speech-to-text (STT) or text-to-speech (TTS). Deepgram offers free credits when you sign up, which allow you to use all features, including real-time streaming via WebSocket, without requiring an immediate upgrade. You only need to upgrade if you require higher usage limits, enterprise features, or self-hosted deployments.
How to use Deepgram WebSocket:
-
Get an API Key:
Sign up at Deepgram and create an API key from the console. This key is required for authentication. -
Connect via WebSocket:
For STT, connect towss://api.deepgram.com/v1/listenwith your API key for authentication. For TTS, use the appropriate endpoint (e.g.,/speakfor TTS). You can authenticate using theAuthorizationheader or, in browser environments, theSec-WebSocket-Protocolheader.Example (Node.js, STT):
const WebSocket = require("ws"); const apiKey = "YOUR_DEEPGRAM_API_KEY"; const ws = new WebSocket("wss://api.deepgram.com/v1/listen", { headers: { Authorization: `Token ${apiKey}` } }); ws.on("open", () => { // Send audio data here }); ws.on("message", (data) => { // Handle transcription results });Example (Browser, using Sec-WebSocket-Protocol):
Set theSec-WebSocket-Protocolheader totoken, YOUR_DEEPGRAM_API_KEYwhen creating the WebSocket connection.
See protocol details -
Send Audio/Text Data:
For STT, stream audio data to the WebSocket. For TTS, send text data.
- Receive Results:
Listen for messages on the WebSocket to receive transcriptions (STT) or audio data (TTS).
Plan Requirements:
- You can use the WebSocket APIs with the free credits provided at signup.
- Upgrade is only necessary for higher usage, enterprise features, or self-hosted deployments.
See pricing and plan details