How to Get an OpenAI API Key
Step 1: Getting Started
To get an OpenAI API key, one must first visit the OpenAI platform website and sign in with an OpenAI account. If you don't have an account, you can create one using your email address or by logging in with an existing Google or Microsoft account.
Figure 1: OpenAI Platform Sign In
Step 2: Creating an API Key
Once logged in, click on your profile icon at the top-right corner of the homepage and select "View API Keys" from the dropdown menu. Then, click on "Create new secret key" to generate a new API key. It's important to save this key immediately as it cannot be retrieved once the window is closed.
Figure 2: Opening profile Figure 3: Creating a New Secret Key Figure 2: Filling name of new key Figure 2: Copying new key
Step 3: Check OpenAI Usage
You can view your API usage by clicking on the "Usage" tab on the left side of the page. This page displays your API key, the number of API requests you've made, and the number of API requests you have remaining.
Figure 3: OpenAI API Usage Chart
Step 4: Troubleshooting
If you encounter an "Incorrect API Key Provided" error, check for typos or extra spaces in your API key, ensure you're not using the key for a different organization or project, and verify if your key has been deleted, deactivated, or cached. If the key still doesn't work, clear your browser's cache and cookies, verify the key's format on OpenAI's authentication page, or generate a new key.
Step 5: API Key Safety
OpenAI also provides an article on best practices for API key safety to help users avoid common problems and understand how the API key process works.