#🚨 WebSocket 401 Unauthorized – Deepgram Streaming Not Working 🚨

1 messages Β· Page 1 of 1 (latest)

gleaming sentinel
#

Hey Deepgram team,

I'm trying to connect to the Deepgram WebSocket API for real-time transcription, but I keep getting a 401 Unauthorized error. Here's what I've tried so far:

1️⃣ Verified my API Key – curl -X GET "https://api.deepgram.com/v1/projects" -H "Authorization: Token MY_API_KEY" β†’ Returns my project, so the key is valid.
2️⃣ Created a new API key with Admin/Owner permissions and ensured Real-time Transcription & Streaming Access are enabled.
3️⃣ Tested WebSocket connection using wscat & Python, but both return:
websockets.exceptions.InvalidStatus: server rejected WebSocket connection: HTTP 401
4️⃣ Tried both US and EU endpoints (wss://api.deepgram.com/v1/listen and wss://eu.deepgram.com/v1/listen).
5️⃣ Checked my Deepgram billing plan – I have sufficient credits and am on the Pay As You Go plan.
6️⃣ Confirmed no typos in API key & that it has streaming access.

Still, no luck! What am I missing? Any help would be greatly appreciated! πŸ™

Thanks in advance! πŸš€

worn fogBOT
#

Thanks for asking your question. Please be sure to reply with as much detail as possible so the community can assist you efficiently.
-# If you haven't done so, ensure your Discord and Github profiles are linked to Deepgram so you can earn points to redeem on cool stuff just by being active!

#

It looks like we're missing some important information to help debug your issue. Would you mind providing us with the following details in a reply?

  • A request ID that triggered your error or issue.
gleaming sentinel
#

Sure! Here’s the requested information:

πŸ”Ή Request ID:
NO9a1ab8493e97d4ec33aa4df1c25ab16f

πŸ”Ή Error Code:
401 Unauthorized

πŸ”Ή WebSocket Connection Attempt:
wscat -c "wss://api.deepgram.com/v1/listen?access_token=MY_API_KEY&encoding=mulaw&sample_rate=8000"
error: Unexpected server response: 401

πŸ”Ή API Key Verification (Worked Successfully):
curl -X GET "https://api.deepgram.com/v1/projects" -H "Authorization: Token MY_API_KEY"
{"projects":[{"project_id":"361ac4c5-b114-4705-a63a-ef05fdfa51fe","name":"MY_Project"}]}

Everything looks correct, but WebSocket connections keep failing with 401 errors. Any ideas? Thanks! πŸš€

#

And if it's relevant:

I'm trying to change the API Key with correct scopes but I don't see an ability to enable Streaming Access, Live Transcription or Real-time API Calls

#

Questions:

Does my Deepgram plan support real-time WebSocket streaming?
Do I need Deepgram support to manually enable streaming for my account?
Thanks for your help! πŸš€

fervent lance