How to create an API secret key with prefix “sk-” only? Always creates “sk-proj-” keys

I want to create a secret API key that starts with “sk-” only, like the old style keys.

However, every time I create a key, it automatically generates with the prefix “sk-proj-” or something similar.

I have already made the $5 payment for the API access, but still cannot create the classic “sk-” keys.

Is there a way to create a secret key that starts exactly with “sk-” and not “sk-proj-” ?

I couldn’t find this option anywhere in the console or docs.

Thanks for the help!

2 Likes

There is no way to currently generate the old-style “sk” key. Even in the default project, it generates “sk-proj” keys. If you really need an “sk” key, you can do some back-end tricks, but it is not sustainable.

Here is an idea:

Generate an “sk-proj”. Then, create a hash table to create a new key in your back-end with prefered “sk-” key format (maybe get the “proj” part out).

Then, when you or others call the API key from the environment, write a directing function to the hash table to call ‘sk-proj’ from the back end with the ‘sk-’ key. Does it make sense?

It is a cumbersome process, though. I would prefer to use ‘sk-proj’ directly.

2 Likes

Hi mustafaakben,

Thanks for your quick response!
To help you better understand my issue, here is the GitHub link to my BlenderGPT add-on repository:
(https://github.com/gd3kr/BlenderGPT)

The add-on strictly requires API keys starting only with “sk-” , not with “sk-proj-” or other prefixes. If there’s any workaround or update that can support this, please let me know.

Looking forward to your guidance!

Best regards,
Ahmet

2 Likes

That old code is going to have a lot more problems then just attempting to incorrectly validate keys. It has way obsolete openai library 0.27.2 included, and neither code to interact with the sdk or the sdk itself is going to perform for you.

GPT-4 in this addon can ONLY be obtained through the OpenAI waitlist

If you are not in a position to rewrite the whole thing, you must abandon the idea.

4 Likes

@_j is most likely right. Your time is better spend on searching and evaluating other options.
Using Deep Research is actually a good time saving starting point for such a scenario.

4 Likes