deepgram / deepgram-python-sdk

Official Python SDK for Deepgram's automated speech recognition APIs.
https://developers.deepgram.com
MIT License
218 stars 58 forks source link

DeepgramSetupError Raised for Valid API Key on SDK Initialization #286

Closed WaukyJose closed 7 months ago

WaukyJose commented 7 months ago

Hi there,

I am encountering an issue with the Deepgram Python SDK where an Invalid API key error is raised during the initialization of the Deepgram client, despite using a valid API key. This issue prevents any interaction with Deepgram's services via the SDK.

Environment: Python Version: 3.12 Deepgram SDK Version: [ 2.12.0] Operating System: [macOS Sonoma 14.3 (23D56)]

Steps to Reproduce: Install the Deepgram SDK via pip: pip install deepgram-sdk Initialize the Deepgram client in a Python script with a valid API key: python Copy code from deepgram import Deepgram dg_client = Deepgram('YOUR_VALID_API_KEY') Run the script.

Expected Behavior: The Deepgram client should be initialized without any errors, allowing further API interactions.

Actual Behavior: The initialization fails with a DeepgramSetupError, specifically stating that the API key is invalid:

....Traceback (most recent call last): File "/lib/python3.12/site-packages/deepgram/init.py", line 33, in init raise DeepgramSetupError("Invalid API key") deepgram.errors.DeepgramSetupError: Invalid API key

Additional Context: The API key has been verified to be correct and active via the Deepgram dashboard. The issue persists across different environments (local development machine, CI/CD pipelines). No modifications have been made to the SDK or its dependencies.

Attempts to Resolve: Ensured that the API key is correctly spelled and does not include leading/trailing whitespace or hidden characters. Reinstalled the Deepgram SDK to ensure the latest version is used. Tested the API key with direct curl requests to the Deepgram API, which succeed, indicating the issue is specific to the SDK.

Any insights, workarounds, or fixes would be greatly appreciated

Cheers!

dvonthenen commented 7 months ago

Hi @WaukyJose Can you post some code that demonstrates this error? This looks like it's been functioning normally for sometime now on v2.12.0.

dvonthenen commented 7 months ago

Hi @WaukyJose

I have not been able to duplicate this. Are you able to provide some code to help demonstrate this issue?

dvonthenen commented 7 months ago

Closing the issue as abandoned. If still having the issue and want to revisit this, please re-open the issue or ping me in Discord to discuss.