How To Get Your Own OpenAI API Key
OpenAI moved its offering of API Keys to a project-based level
In the last few years, OpenAI changed a bit and if you follow older guides they might not be very accurate.
As of 2024, the recommended way to get your own API key is through Projects. Projects are shared environments where teams can collaborate and share API resources. This helps you set limits etc.
Create A New Project
First of all, create a new project. Go to the Projects page and create a new project from the vertical menu on the left.
In the pop-up, add your project name e.g. React AI Image Generator, and create a new project. On the next page, you will see your project name and the project ID, which will be useful later.
Allow Models
Make sure you are in the correct project. You can see the project name on the navigation bar on top of the screen. In the picture below, it’s called React AI Image Generator.
Go to Limits from the vertical menu on the left. In the section Model usage, allow to use dall-e-3, or any other model you may want to use.
It is a good practice to only select the models you think you will use and add more as necessary.
Create A New API Key
Go to the API Keys page and click on the button Create new secret key.
In the next pop, just add the name of your API key so you can remember it in the future. Every project could use more than one API key for different things.
Once you create the key, you should save it somewhere safe and accessible. For security reasons, you won’t be able to view it again through your OpenAI account. If you lose this secret key, you’ll need to generate a new one.
This sounds more scary than it actually is. But it is correct. If you lose your API key, you will have to create a new one.
In the same way, you can create as many keys as you need.
