How to Get an OpenAI API Key
Learn how to get an OpenAI API key, find a lost key, understand API pricing, set limits, and store your secret safely for app use.
What Is the OpenAI API?
What is OpenAI API? It is a service that lets software send requests to OpenAI models.
The model can return text, images, structured data, or other results. Your app sends input and receives a response.
What is an OpenAI API key? It is a secret code that lets your app use the service.
An API key for AI works like a password for software. It links requests to your project and billing account.
ChatGPT access and API access are separate. A ChatGPT plan does not always include API credit.
- Use API keys for apps and scripts
- Keep each key private
- Track use through the platform dashboard
- Delete keys that you no longer need
How to Get an OpenAI API Key
To learn how to get OpenAI API key access, start with the official API platform.
- Open the API site. Visit OpenAI's API platform. Choose sign up or sign in.
- Create an account. Use an email address that you can access.
- Verify your details. Follow each email or account check shown during setup.
- Open your project. Pick the project that will use the key.
- Open the key page. Find the API keys area in the project settings.
- Create a secret key. Choose the option for a new key. Add a clear name.
- Copy the key. Save it in a password manager or secret store.
- Set a budget. Add billing details when paid use requires them.
This process explains how to get an OpenAI API key for a new project. It also answers, “How do I get an OpenAI API key?”
If you ask how to create OpenAI API key access, the key page is the right place. The full secret often appears only once.
For local work, store the value in an environment variable. A common name is OPENAI_API_KEY.
Your code can read that value without placing the secret in source files. This setup helps protect the key.

Understanding OpenAI API Pricing
How much is OpenAI API use? The answer depends on the model and your request volume.
Most API charges use tokens. Tokens are small parts of the text sent and received.
Input tokens come from your prompt. Output tokens come from the model response.
Each model has its own rates. Check OpenAI's API pricing before you test.
How much is an OpenAI API key? The key itself has no separate purchase price.
How much is OpenAI API access? Your bill comes from API use, not from making the key.
Free Use, Tiers, and Limits
Some accounts may receive trial credit. Free access is not guaranteed for every account.
Offers can change with account status, region, or current company terms. Check your dashboard for the latest details.
Which AI API key is free? A key may cost nothing to create. Requests can still need paid credit.
Small models may cost less for simple tasks. Larger models may suit harder work but cost more.
- Start with a small test budget
- Keep prompts short during testing
- Limit the response size
- Review token use often
- Set project spending limits
Usage limits can affect request speed or volume. Limits may vary by account history and model choice.
A budget lowers risk. It may not stop every charge at once.

Where to Find Your OpenAI API Key
Where do I find my OpenAI API key? Sign in to the API platform first.
Then choose the project that owns the key. Open that project's API keys page.
This answers where to get OpenAI API key details. It also helps if you ask, “Where is my OpenAI API key?”
Check the project name before taking other steps. Many missing-key problems come from viewing the wrong project.
How to see OpenAI API key details depends on the key state. The dashboard may show a name and shortened value.
The full secret may not appear again after creation. If you lost it, create a new key.
How to Store the Key Safely
Never place a key in browser code. Visitors could copy it from the page.
Never commit a key to a public code site. Automated tools often scan public files for secrets.
Use a separate key for each app when possible. Then you can remove one key without stopping every app.
- Use an environment variable for local work
- Use a secret store for shared systems
- Give keys clear names
- Rotate keys after a suspected leak
- Delete unused keys
Common Problems With API Keys
A new key may fail when the app uses the wrong project. Check the project name and environment variable.
A missing variable can also cause an error. Restart your app after adding a new local value.
Do not share the secret while asking for help. Share the error message instead.
If a key appears in public code, delete it at once. Make a replacement before testing again.
What If You Cannot Create a Key?
Check your email and account checks first. Some accounts need more details before API access opens.
Next, check billing settings and project access. An unpaid balance or missing role may block requests.
Read the current OpenAI API documentation for setup notes and error details.
Contact official support if the dashboard still blocks access. Do not send your secret key in a support message.
Next Steps for Safe API Use
You now know how to find OpenAI API key access in the platform dashboard. You also know how to create a replacement key.
Start with one small request. Watch your token use and review the first bill.
Keep the key on your server when an app has public users. Your server can call the API without exposing the secret.
Review your keys each month. Remove old keys and lower limits when a project ends.
These steps make API access easier to manage. They also reduce the cost of a leaked key.
Step-by-step
- 01 Open the API platform
Visit the OpenAI API platform and choose sign up or sign in.
- 02 Create and verify your account
Use an accessible email address. Complete each account or email check shown during setup.
- 03 Choose a project
Open the project that will use the API key.
- 04 Create a secret key
Open the project's API keys page. Create a key and give it a clear name.
- 05 Save the key safely
Copy the secret once. Store it in a password manager or secret store.
- 06 Set spending limits
Add billing details when needed. Set a small test budget before sending many requests.
Frequently asked questions
- How do I get an OpenAI API key?
- Open the OpenAI API platform, sign in, choose a project, and open its API keys page. Create a new secret key there.
- Where do I find my OpenAI API key?
- Sign in to the OpenAI API platform and select the correct project. The key name appears on that project's API keys page.
- How can I see my OpenAI API key again?
- The full key value may appear only during creation. If you lost it, create a new key and delete the old one.
- How much is the OpenAI API?
- The key itself has no separate purchase price. API charges depend on the model, input tokens, output tokens, and request volume.
- Is there a free OpenAI API key?
- Some accounts may receive trial credit, but free access is not guaranteed. Check the current billing details in your platform account.
- Does ChatGPT Plus include API access?
- No. ChatGPT access and API access use separate account areas. A ChatGPT plan may not include API credit.