I keep getting the following error message when trying to run my app openai.AuthenticationError: Unauthorized: Invalid API key!
. I don’t know why I keep getting the error, I’ve tried regenerating a new API key 3 times but it still kept giving me the same error.
Hi albasufaisal,
Thank you for reaching out. We see that you’re encountering the “Unauthorized: Invalid API key” error despite regenerating your API key multiple times. We will look into the issue and investigate further. We’ll keep you updated on our progress and let you know once the issue is addressed.
It will be great if you give additional or more information about the code which you are using.
Thank you
Regards,
Rohit
I’ve finally been able to get it to work, it took having to regenerate the API keys a couple more times but it’s finally working now. Thanks anyway for the prompt response.
P.S. I was using it in a streamlit app and accessing the key via environment variables.
This is quite interesting . A lot of our demos are steamlit apps and I have yet to encounter this. I am wondering if he env variable was getting malformed somehow.
-Coby
That might be a possibility, I’ll try to investigate a bit more and see if I can reproduce the bug, that might give a clue where exactly the issue originated from.
I’m brand new to SambaNova cloud, and just tried the AI Starter Kits > Quickstart, and had the same problem.
I regenerated the API key again, and it worked. Strange you have to do it 2x though.