How to get an OpenAI API key
Sign in at platform.openai.com, add credit under Billing, then create a key on the API keys page and copy it straight away. OpenAI shows the full key only once.
Updated
Getting a key takes three things on OpenAI’s website: an account, some credit and the key itself. Then you paste it into WLN once.
Before you start
- The API isn’t part of ChatGPT. A ChatGPT Plus or Pro plan doesn’t include API credit, and the two are billed separately (OpenAI help, checked 5 Dec 2026).
- You pay before you use it. API billing is prepaid. OpenAI lists the smallest purchase as $5, and bought credit expires after one year, or 180 days for credit bought in Japan from 13 November 2026 (OpenAI help, checked 5 Dec 2026).
OpenAI changes its dashboard now and then. If a button below has a new name, the linked help page will have the current one.
Step 1: Sign in to the OpenAI platform
Go to platform.openai.com and sign in, or create an account. This is OpenAI’s site for developers, separate from the ChatGPT app.
Step 2: Add credit
Open the billing page (platform.openai.com/account/billing) and add credit to your balance.
During setup OpenAI turns on auto-reload, which buys more credit when your balance runs low (OpenAI help, checked 5 Dec 2026). Leave it on if you don’t want replies to stop, or switch it off if you’d rather never be charged without deciding first.
Step 3: Create the key
Open the API keys page and choose Create new secret key. Give it a name you’ll recognise later, such as “WLN on my MacBook”, and pick the project it belongs to.
Copy the key as soon as it appears. OpenAI shows the full key only once. If you lose it, delete it and make a new one.
Sources, checked 5 Dec 2026: where to find your API key and keys in projects.
Step 4: Set a spending limit at OpenAI
In your organization settings, open the project and go to Limits. There you can set a Monthly spend limit and turn on Enforce a hard limit, which stops requests once the limit is reached. OpenAI notes the check isn’t instant, so spending can go slightly over. An alert only warns you. It doesn’t stop anything (OpenAI help on projects, checked 5 Dec 2026).
We’d set a hard limit even if it’s a high one. If the key ever leaks, the damage has a ceiling.
Step 5: Put the key in WLN
- In WLN, open Settings › Models and API key and find the OpenAI key section.
- Paste the key and press Save. WLN checks it with OpenAI and keeps it in Keychain on your Mac.
- WLN asks “Send your chats to OpenAI?”. Press Allow. No chat goes to OpenAI until you do.
- When the line turns green and says “Saved. OpenAI models are ready.”, the key works. The Test button checks it again whenever you like.

WLN can’t tell an OpenAI key from a SubQ key by its look, since they start the same way. So paste an OpenAI key into the OpenAI section.
Next, give an OpenAI model a job. In Settings › Models and API key › Team, choose Custom, set a role’s provider to OpenAI and pick a model. The menu shows each model’s price per million tokens. If OpenAI is your only key, do this for every role you use.

WLN’s own limit works alongside OpenAI’s: every new chat stops at $5 unless you raise it. More in Get started with WLN.
Using the key in your own scripts
OpenAI suggests keeping the key in an environment variable called OPENAI_API_KEY (OpenAI, checked 5 Dec 2026). On a Mac, you can add it to your shell settings. In Terminal, open the file:
touch ~/.zshrc && open -e ~/.zshrc
Add this line with your key in place of the placeholder, save, and open a new Terminal window:
export OPENAI_API_KEY='paste-your-key-here'
Pasting the key into the file, not into a Terminal command, keeps it out of your shell history.
That stores the key as plain text in ~/.zshrc, so keep that file out of anything you share or back up to a public place. WLN doesn’t read this variable. It uses the copy you saved in Settings, which stays in Keychain.
Keep the key safe
- Never paste it into a chat, an email or a code repository.
- Don’t put it in a website’s or a phone app’s code. Anyone who downloads them can read it.
- Use one key per app or per Mac, so you can delete one without breaking the rest.
- If a key leaks, delete it on the API keys page right away. A deleted key stops working.
OpenAI’s own list is on its key safety page (checked 5 Dec 2026).
When something goes wrong
These are the messages WLN shows for the usual OpenAI problems, and what to do about each.
| WLN says | What it means | What to do |
|---|---|---|
| OpenAI says it doesn’t recognise this API key. | The key is wrong, was deleted, or has a stray space. | Copy the key again, or make a new one and paste it in Settings. |
| OpenAI says this account has no credit left or reached its spending limit. | The balance is empty, or a spend limit was reached. | Add credit or raise the limit on OpenAI’s site. Trying again won’t help until you do. |
| OpenAI says too many requests were sent. | A rate limit: too much in a short time. | WLN waits and tries again by itself first. If it still fails, wait a moment. |
| OpenAI says “model name” isn’t available to this account. | Your account can’t use that model yet. | Choose another model in Settings › Models and API key › Team. |
Questions
Is the OpenAI API free?
No, it’s pay as you go. You buy credit first, and each request is taken from it. OpenAI says the smallest purchase is $5 and that bought credit expires after a year (checked 5 Dec 2026). If your account has free credit, it’s used first.
Does ChatGPT Plus include API access?
No. ChatGPT plans and the API are billed separately, and a ChatGPT subscription doesn’t include API credit (OpenAI, checked 5 Dec 2026).
How much does a chat in WLN cost with my OpenAI key?
It depends on the model and how long the chat gets. WLN shows the cost under every reply, and the model menu in Settings lists each model’s price per million tokens. Every new chat also has a $5 limit you can change. See Pricing.
Can I use the same key on two Macs?
It works, but one key per Mac is better. If one Mac is lost or a key leaks, you delete that key and the other keeps working. OpenAI also asks that each person uses their own key (OpenAI, checked 5 Dec 2026).
Where does WLN keep my OpenAI key?
In Keychain on your Mac. WLN sends it only to OpenAI.
OpenAI, ChatGPT, GPT, SubQ, OpenRouter, DeepSeek and GLM are trademarks of their owners. WLN is an independent app and isn’t affiliated with or endorsed by them.