HomeFeaturesPricingBlogFAQContact
← All articles

How to Get an OpenAI API Key (Step by Step, 2026)

Key takeaways
  • OpenAI API keys are created in the OpenAI platform dashboard at platform.openai.com under the API keys section, and the full key is shown only once at creation.
  • The API is pay-per-token and billed separately from ChatGPT Plus -- a Plus subscription does not include API access, and API usage does not require Plus.
  • Treat the key like a password: never paste it into untrusted sites, never commit it to a repository, and set a monthly usage limit in the billing settings as a safety net.
  • One key unlocks GPT models in any BYOK app, so you can use GPT inside third-party tools at raw token prices.

An OpenAI API key is a credential that lets software call GPT models directly and pay per token, instead of going through the ChatGPT website. Getting one takes about five minutes and does not require a ChatGPT Plus subscription — the API is a separate product with separate billing. Here is the whole process, plus the safety habits that matter.

Step 1: Create or sign in to an OpenAI platform account

Go to platform.openai.com — note this is the developer platform, not chat.openai.com. You can sign in with the same account you use for ChatGPT, but the billing is independent: API credit and ChatGPT Plus are two different wallets.

Step 2: Add billing

New accounts generally need a payment method or prepaid credit before keys will work. In the platform dashboard, open the billing settings and either add a card or buy a block of prepaid credit. Prepaid is a good idea for personal use — it is a hard ceiling on what you can spend.

While you are there, set a monthly usage limit. This is the single best safety habit for API beginners: even if a key leaks or a script loops, the damage stops at your limit.

Step 3: Create the key

In the dashboard, find the API keys section and click to create a new secret key. Give it a name that says where you will use it ("bytechat-laptop", "weekend-project") — future you will thank present you when it is time to revoke one.

The full key is shown once, at creation. Copy it immediately and store it somewhere safe like a password manager. If you lose it, you cannot view it again — you just create a new one and delete the old.

Step 4: Use it

The key now works anywhere that accepts an OpenAI key. The big categories:

Keeping the key safe

Three rules cover most real-world risk:

  1. Never commit a key to a code repository. Automated scrapers find exposed keys in public repos within minutes. Use environment variables or a secrets manager.
  2. Only paste keys into software you trust. For web apps, prefer tools that state clearly where the key is stored — keys kept in your browser's local storage and sent only to the provider are a much smaller surface than keys uploaded to someone's server.
  3. Rotate on suspicion. Revoking a key takes seconds and breaks nothing except the things you re-paste it into. If usage on the billing page looks unfamiliar, rotate first, investigate second.

API key vs ChatGPT Plus: which do you need?

They answer different questions. Plus is a flat monthly subscription for the ChatGPT app. The API key is metered access to the models themselves, billed per token, usable in any tool. Light and moderate chat users often find pay-per-token works out cheaper than a subscription; heavy daily users can go either way. Nothing stops you from holding both — many people keep Plus for the app and a key for everything else.

Frequently asked questions

Is an OpenAI API key free?

Creating a key is free, but using it is pay-per-token, and new accounts typically need billing set up before keys work. Costs scale with usage — light chat use is typically cents, not dollars, per day.

Does ChatGPT Plus include API access?

No. Plus covers the ChatGPT app only. API usage is billed separately per token, and you can use the API without a Plus subscription at all.

Can I see my API key again after creating it?

No — the full key is displayed only once at creation. If you lose it, create a new key and revoke the old one; this takes seconds and is the normal workflow.

Put your new key to work

Paste your OpenAI key into ByteChat and GPT joins a chatroom alongside Claude, Gemini and others — same key, raw token pricing, and the key never leaves your browser.

Try ByteChat free →