Sunday, July 21, 2024

How to Get an OpenAI API Key

ChatGPT Plus RG
Hannah Stryker / How-To Geek
  1. Go to OpenAI’s Platform website at and sign in with an OpenAI account.
  2. Click your profile icon at the top-right corner of the page and select “View API Keys.”
  3. Click “Create New Secret Key” to generate a new API key.

Lots of applications and AI tools now require you bring your own OpenAI API key. You can generate one on OpenAI’s website, and it comes with $5 of free credit. Here’s how to get started with OpenAI’s API to get ChatGPT-style AI features outside of the standard ChatGPT interface.

How to Get an OpenAI API Key

To begin, head to OpenAI’s official platform website. If you haven’t already, create an account following the simple steps on the website. After that, you can enter the email address and password linked to your OpenAI account to sign in or log in with an existing Google or Microsoft account.

Once you’ve created an account or have logged into an existing account, you’ll see your name and your profile icon at the top-right corner of OpenAI’s platform homepage.

To get an API Key, click on your name in the top-right corner to bring up a dropdown menu. Then, click the “View API keys” option.

Numbered red arrows showing how to get to the page on OpenAI's website where you can generate an API Key.

At this point, you’ll be on a page that has an option to “Create new secret key” near the center. If you do not have an API key, click this button to get one. Make sure to save the API key as soon as possible. Once the window showing it closes, you won’t be able to reopen it.

A red arrow pointing to a button that says "Create new secret key".

Is an OpenAI API Key Free?

You can create an OpenAI API key for free. New free trial users receive $5 (USD) worth of credit. However, this expires after three months. Once your credit has been used up or expires, you can enter billing information to continue using the API of your choice. Keep in mind that if you don’t enter any billing information, you will still have login access but won’t be able to make further API requests.

OpenAI enforces rate limits at the organization level; if you’re using their tools for business, you’ll have to pay depending on a few factors. Rate limits are measured in two ways: RPM (requests per minute) and TPM (tokens per minute).

If you’re looking for specific costs based on the AI model you want to use (for example, GPT-4 or gpt-3.5-turbo, as used in ChatGPT), check out OpenAI’s AI model pricing page. In many cases, the API could be much cheaper than a paid ChatGPT Plus subscription—though it depends how much you use it. For a complete overview of exact rate limits, examples, and other helpful information, visit OpenAI’s Rate Limits page.

RELATED: GPT 3.5 vs. GPT 4: What’s the Difference?

How to Fix “Incorrect API Key Provided” for OpenAI

Before you send email complaints to OpenAI, you should check the following:

  • Scan for typos and extra spaces in your API Key
  • Make sure you’re not using the API Key for a different organization or AI project
  • Verify if your API Key has been deleted, deactivated, or cached

Avoiding the above-mentioned errors can quickly and easily solve your problem and let you get back to work as soon as possible.

What to Do If an OpenAI API Key Isn’t Working

If you’re still having issues despite not having any of the errors we listed above, try clearing your browser’s cache and cookies before trying again.

To make sure your API key is formatted correctly, you can consult the authentication page on OpenAI’s platform website. This page goes into detail about how to verify if your API is working through how requests are made and also lists some helpful examples. If all else fails, you can potentially generate a new API Key (follow the steps at the top of this article).

Additionally, we recommend taking a look at OpenAI’s article about best practices for API Key safety. It can help you steer clear of common problems and it also breaks down how the API Key process works.

RELATED: What is an “API”, and How Do You Use One?


This website uses cookies. By continuing to use this site, you accept our use of cookies.