OpenAI icon indicating copy to clipboard operation
OpenAI copied to clipboard

Incorrect API key provided

Open AlYehorov opened this issue 1 year ago • 3 comments

Hello guys, I have faced with issue that's my API key incorrect. I've tried to create a new one but still have the same problem. Previously everything was ok. I have money on my OpenAI acc so it's not related to an empty balance or something like that.

Any idea why I have it ?

APIErrorResponse(error: OpenAI.APIError(message: "Incorrect API key provided: "sk-proj**********************************************". You can find your API key at https://platform.openai.com/account/api-keys.", type: "invalid_request_error", param: nil, code: Optional("invalid_api_key")))

OpenAI 0.2.6 version (SPM package)

AlYehorov avatar Apr 29 '24 19:04 AlYehorov

OpenAI recently rolled out per project API keys with the following format:

sk-proj-abcdefghijklmnopqrstuvwxyz1234567890abcdef

Although this article doesn't seem to mention this specific format change you can read about it here: https://help.openai.com/en/articles/9186755-managing-your-work-in-the-api-platform-with-projects

You might be able to create a your own Project API key to verify here: https://platform.openai.com/api-keys

This library likely does a format check to confirm that the key is the expected classic key format so that the user didn't accidentally type or paste the wrong text somehow.

sk-abcdefghijklmnopqrstuvwxyz1234567890abcdef

ThatGuySam avatar May 06 '24 16:05 ThatGuySam

OpenAI recently rolled out per project API keys with the following format:


sk-proj-abcdefghijklmnopqrstuvwxyz1234567890abcdef

Although this article doesn't seem to mention this specific format change you can read about it here:

https://help.openai.com/en/articles/9186755-managing-your-work-in-the-api-platform-with-projects

You might be able to create a your own Project API key to verify here:

https://platform.openai.com/api-keys

This library likely does a format check to confirm that the key is the expected classic key format so that the user didn't accidentally type or paste the wrong text somehow.


sk-abcdefghijklmnopqrstuvwxyz1234567890abcdef

I know that, even with new key (project key) it does not work. That's why I'm asking here about that)

AlYehorov avatar May 06 '24 16:05 AlYehorov

Hey bro can u provide me open ai api key for testing out a project u can deactivate after 1 hour plzz my credits are already expired help me out

vkix-7 avatar May 09 '24 18:05 vkix-7