You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth error

Hi,

I have been having this error all of a sudden since this morning. It was working before, i was doing some changes to the code however i revert back to the last commit which was a stable point and it did not change a thing.

I created new api keys, i filled up my api charges, nothing changed.

I am somehow sure its not on my end issue, why could be the reason ? Thanks ! Here the full json response

{
"error": {
"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

Welcome to the community!

Are you absolutely sure it’s not an issue on your end?

Have you tried to see if your playground still works (on platform.openai.com)? If that does, the next step is to copy the playground code (copy code button) and see if that works in your machine. If that works, it’s definitely a code issue on your end :confused:

Can you try the above steps and see where you get stuck?