How to Get a ChatGPT API Key (Setup, Cost and Pitfalls)
An API is the connection that lets one piece of software talk to another without a person sitting in the middle, and an API key is the password-like string that tells the other side who's calling. Getting a ChatGPT API key gives you that string, so you can put ChatGPT inside an automation that runs without you or an internal tool your team uses, rather than typing into the chat window every time. The setup itself takes about five minutes. This guide covers all of it, what you should expect to spend, and where to find your keys again afterwards. If you'd rather watch it happen, the 9x tutorial runs through the same steps on screen.
Your ChatGPT subscription doesn't include API access
Your ChatGPT Plus or Pro subscription and API access are separate products with separate billing, so paying for one gives you none of the other, even though both carry the same brand and the same models.
API keys live at platform.openai.com, which is a different site from the one you chat on. Even if you've used ChatGPT daily for two years, you'll need to create an account there from scratch.
You can sign up with Google, Microsoft or Apple, or with an email address and a password of at least 12 characters. Verify the email, then fill in your name and date of birth.
Next you name an organisation. An organisation is the container OpenAI puts your account in, holding your billing details, your team members and your keys in one place. I tell people this can be your company name, but it can be whatever you like, because nothing about the label itself is binding. What sits behind the label is worth a minute of your attention, though, because it decides how team access works.
One developer account can serve your whole team
After creating the organisation you're offered the option to invite team members, and this is where the developer account behaves differently from ChatGPT.
In ChatGPT, everyone on your team has their own account. On the API side, one developer account can be shared across many people, so rather than five colleagues each creating an account and each setting up billing, you run one organisation and invite them into it.
Be precise about what gets shared, though. OpenAI is explicit that sharing a key is against the Terms of Use, and that each team member should be invited to the account so they receive their own unique key. Share the organisation, never the key itself.
Inside an organisation you can also create projects, which are separate workspaces with their own keys and their own spending limits. That's how you stop a client-facing tool and an internal experiment from drawing on the same untracked pot of credit.
The upshot is a single place to see spend, a single set of keys to manage, and one bill instead of five. It's the same pattern that makes AI tooling manageable across a business, and if you're setting this up for a company rather than for yourself, it's worth doing as an organisation from the start, because retrofitting it later means reissuing keys and updating every place they're used. You can skip the invitations during setup and add people afterwards.
Generating your ChatGPT API key, saving it and adding credit
Now you generate the key. You can give it a name and assign it to a project, or accept the defaults and press the button.
OpenAI shows you the key once, at the moment it's created, and never displays it again. Copy it straight away and put it somewhere you'll find it later. A password manager is the right home for it, rather than a sticky note, a Slack message to yourself, or a shared document. An API key can spend your money, so treat it the way you'd treat a card number.
If the key is going into code, OpenAI recommends storing it as an environment variable named OPENAI_API_KEY rather than pasting it into a file. An environment variable is a value your system holds outside the code itself, so the key doesn't travel with the file. Committing a key to a repository is one of the common ways they leak, and a key shouldn't be deployed inside a browser or mobile app either, where a user can read it.
If you lose the key, you can't recover it. You generate a new one and update everywhere the old one was used.
The second step is the one people skip. Don't take a fresh key and start using it straight away, because you need to press continue and add some credit first. A key with no credit behind it is inert and fails every call it makes, which looks like a broken key or broken code when the actual problem is an empty balance.
What the ChatGPT API costs and how much credit to start with
The API runs on prepaid credit rather than a monthly subscription. You add an amount, your calls draw it down, and you top up when it runs low.
If you're unsure how much to put in, I'd start with $5, because it lasts a long time and it's enough to build something real and watch your consumption before you commit more. Current model pricing is charged per million tokens, and a token is roughly a short word or a fragment of one, so a page of text works out at a few hundred tokens. The cheaper models run to fractions of a cent per request. Prices have come down repeatedly over the past few years, so check the pricing page rather than trusting a figure you remember.
Set your usage limits on day one. The billing section lets you cap monthly spend and set a billing threshold, which is the amount of usage that triggers an email alert so you hear about a problem before the invoice does. A loop in a badly written script can burn through credit fast, and a hard cap costs nothing to put in place.
Accounts also carry rate limits: caps on how many requests, and how many tokens, you can send in a given window. They exist so no single account can overwhelm the service, and they're set per project, so a test project can't eat into what the rest of your work is allowed.
On the free key question, there's no permanent free ChatGPT API key. Promotional credits turn up from time to time and then expire, and sites advertising unlimited free keys are either sharing someone else's credentials or collecting yours.
Add your payment details, buy the credit, and the key goes live. If you're weighing up the two big providers, getting a Claude API key follows much the same pattern.
Finding and managing your keys later
OpenAI's developer quickstart is the fastest route from a working key to a first request.
Once the account exists, go to the dashboard and select API keys in the left-hand menu. Every key you've created is listed there, and you can rename one, delete one, or create another.
Once more than one thing is using the API, give every key a name that identifies where it's used and issue a separate key per application. Then, when a key needs rotating or switching off, you revoke that single key rather than taking down the other tools along with it.
One thing worth checking before you generate anything: if you're connecting a tool someone else built rather than writing your own code, see whether it supports a shared standard for plugging AI models into other software, called MCP, which both OpenAI and Anthropic now support. A connector built on MCP often removes the need to hand a raw key to a third party at all.
Common questions
Does my ChatGPT Plus subscription include API access? No. They're separate products with separate billing, and a Plus or Pro subscription gives you no API credit.
Why isn't my API key working? The likeliest reason is that there's no credit on the account, because a key generated without credit behind it fails every call. Check the billing page before you start debugging anything else.
Can I see my API key again after generating it? No. It's displayed once, at creation. If you didn't save it, generate a new key and update wherever the old one was used.
How much should I start with? $5 is a sensible starting point. It lasts a long time at current pricing and it shows you your real consumption rate before you commit more.
Can my team share one API key? Share the organisation rather than the key. Invite colleagues into your developer account and issue keys per application, so you can revoke one without disrupting the others.
Is there a free ChatGPT API key? Not a permanent one. Promotional credits appear from time to time and expire, and anywhere advertising unlimited free keys is best avoided.
read next
What is ChatGPT Sites and How to Use It (3 Killer Use Cases)
What is ChatGPT Sites? OpenAI's site builder in ChatGPT that ships a live site from a prompt. Three real builds it handled, and the limits worth knowing first.
ChatGPT Work vs Chat: What's the Difference?
What are the key differences between ChatGPT Work and the standard chat? And when should you use each one?


