You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is an issue with the Python library and not an underlying OpenAI API
This is an issue with the Python library
Describe the bug
If you use an ENV var for setting the API key, and the ENV happens to be empty, no exception is thrown until a call is made and the exception is ambiguous (i.e., not clear that the token is empty).
To Reproduce
export OPENAI_API_KEY=""
and use the completions API
Code snippets
OS
15.3
Python version
v3.13.1
Library version
1.61.0
The text was updated successfully, but these errors were encountered:
Hi @iloveitaly, thanks for raising this. From what I’ve seen the API itself eventually throws an error when the API key ENV variable is empty. That said, I'll set up a PR to catch this earlier and provide a clearer message. Let's see what the OpenAI team has to say. Thanks for your patience and input!
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
If you use an ENV var for setting the API key, and the ENV happens to be empty, no exception is thrown until a call is made and the exception is ambiguous (i.e., not clear that the token is empty).
To Reproduce
and use the completions API
Code snippets
OS
15.3
Python version
v3.13.1
Library version
1.61.0
The text was updated successfully, but these errors were encountered: