# How to get an OpenAI API key

Sign in at platform.openai.com/api-keys, create a new secret key and copy it right away: it is shown only once. Plus: billing, free credits and how to keep it safe.

Tool: ChatGPT. By ColdIQ team. Updated 2026-11-23. Source: https://coldiq.com/university/chatgpt/openai-api-key

## In short

- An OpenAI API key is a secret password that lets a program, such as a no-code tool or your own script, use OpenAI’s models.
- You create and manage keys on the API key page at platform.openai.com/api-keys. The full key is shown only once, when you create it.
- ChatGPT and the API are billed separately: a ChatGPT Plus subscription does not pay for API usage.
- Pro and eligible Business subscriptions include monthly API credits, from $100 a month on Pro $100 to $500 on Pro $500, as of November 2026.
- Never share a key or put it in public code. If a key leaks, delete it and create a new one.

## Steps

1. Sign in to the OpenAI platform and open platform.openai.com/api-keys.
2. Create a new secret key, name it after the tool that will use it, and copy it.
3. Add credits in the API billing settings, then paste the key into your tool.

## What is an OpenAI API key?

The API (application programming interface) is how software talks to OpenAI’s models without the ChatGPT app. An API key is the password that proves a request comes from your account, and it decides who gets billed.

You need one when a tool asks for it: an automation platform, a CRM add-on, a writing tool, or a script a developer writes for your team.

You do not need one to use ChatGPT itself. ChatGPT on the web, desktop and phone works with your normal login.


## How do you create an OpenAI API key?

Keys are created on the OpenAI developer platform, not in ChatGPT settings.

1. Go to platform.openai.com and sign in, or create an account.
2. Open the API key page at platform.openai.com/api-keys.
3. Create a new secret key. Give it a clear name, such as the tool that will use it.
4. Copy the key right away and store it somewhere safe. OpenAI shows the full key only at creation.

Tip: Lost the key? You cannot see it again. Create a new one, update your tool, then delete the old one with the trash can icon next to it.


## Is the OpenAI API key free?

Creating a key costs nothing. Using it is billed by usage: you pay for the tokens (pieces of words) the model reads and writes, plus any tool or storage fees. The API pricing page lists the rate for each model.

OpenAI’s developer quickstart lets you run a free test request. After that, you add credits in the API billing settings to keep building.

Some ChatGPT plans now include API credits. As of November 2026, Pro $100 gets $100 a month, Pro $200 gets $200 and Pro $500 gets $500. Eligible Business workspaces get $20 per Standard seat and $100 per Premium seat, pooled and capped at $500 a month. Plus, Enterprise and Edu are not eligible.


## Does ChatGPT Plus include API access?

No. OpenAI says ChatGPT and the API platform have separate billing systems. Your Plus subscription is paid in ChatGPT settings, and API usage is paid in your API account.

To claim the API credits that come with Pro or Business, use the same email for both accounts. In ChatGPT, go to Settings > Billing (Pro) or workspace billing (Business), find the API credits benefit, pick your API organization and confirm.

Unused monthly credits do not roll over. Downgrading to Plus, Go or Free removes the link at the end of the billing cycle.


## How do you use the key in a tool?

Most no-code tools have a field labeled API key or OpenAI key. Paste the key there and save.

For scripts, OpenAI recommends storing the key in an environment variable named OPENAI_API_KEY rather than in your code. The official SDKs (code libraries) read it from there automatically.

On Mac or Linux, a developer sets it in the terminal with export OPENAI_API_KEY="your_api_key_here". On Windows PowerShell, setx OPENAI_API_KEY "your_api_key_here" saves it for new terminal windows only. For the window already open, also run $env:OPENAI_API_KEY="your_api_key_here".


## How do you keep your API key safe?

Anyone with your key can spend your credits. OpenAI’s safety guidance comes down to a few habits.

- Give each person their own key. Invite teammates as members instead of sharing one key.
- Never put a key in a website or mobile app, where visitors could read it. Keep it on a server.
- Never commit a key to a code repository, especially a public one.
- Set a monthly spend limit with hard enforcement on the Limits page of your organization or project settings. Alerts alone do not stop traffic.
- Rotate keys: replace them on a schedule, and right away if you think one leaked.


## Sources

- [setx command (Microsoft Learn)](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx)
- [Where do I find my OpenAI API key?](https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key)
- [Developer quickstart](https://developers.openai.com/api/docs/quickstart)
- [Best practices for API key safety](https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety)
- [Managing billing for ChatGPT and the API platform](https://help.openai.com/en/articles/9039756-managing-billing-for-chatgpt-and-the-api-platform)
- [API credits benefit for eligible ChatGPT subscriptions](https://help.openai.com/en/articles/20001626-api-credits-benefit-for-eligible-chatgpt-subscriptions)

## Questions

**Where do I find my OpenAI API key?** On the API key page at platform.openai.com/api-keys. You can only see the full key when you create it, so create a new one if you lost it.

**Can I get an OpenAI API key for free?** Creating a key is free and the quickstart allows a free test request. Real use needs API credits, or a Pro or Business plan that includes them.

**Is the OpenAI API key the same as my ChatGPT login?** No. ChatGPT uses your normal login. The API uses a secret key from the developer platform, with separate billing.

**What happens if I delete an API key?** It stops working at once, so any tool that uses it will fail until you paste in a new key.


## Related

- [How much is ChatGPT Plus?](https://coldiq.com/university/chatgpt/chatgpt-pricing)
- [How to get a Claude API key](https://coldiq.com/university/claude/claude-api-key)

## Try ColdIQ free

ColdIQ gives new accounts up to 1,450 free credits as they get started, no credit card required.
One subscription covers 40+ B2B data providers for finding, enriching and verifying
contacts and companies, through the web app, the API or the MCP server for AI agents.

1. Create an account: https://coldiq.com/marketplace/sign-up?utm_source=ai-assistant&utm_medium=markdown&utm_content=university
2. Run a first search on your own market with the free credits.
3. Connect the MCP server to Claude, ChatGPT or Cursor: https://coldiq.com/mcp
