Guide
How to get an OpenAI API key, step by step
The OpenAI API key is the most requested way into pay-per-use AI. Account, billing, key generation and security are all covered here, with the exact path and no detours.

Creating an OpenAI API key takes five minutes. You need an account on the developer console, a payment method and one click on "Create new secret key". This key gives you access to the GPT models at the official list price, billed by consumption. There's no plan and no credits to buy back, because you pay for the volume actually processed, which comes to a few cents for most uses.
The process is simple, yet two settings get decided at creation time. One is the spending cap and the other is where you store the key. The four steps follow in order, with prices recorded in October 2026 and the traps to avoid along the way.
01Key takeaways
- The key is free to create on OpenAI's developer console. What you pay for is usage, at the provider's official rates.
- Plan on entering a payment method, since OpenAI no longer gives new accounts a trial credit as a rule.
- The key starts with "sk-" and is shown only once, so copy it straight to the right place.
- Set your monthly budget and an alert threshold before your first request, while the console is open.
- Once pasted into a compatible tool, the key gets to work. Writing an article costs a few cents.
02What an OpenAI API key is for
The key is a secret identifier that links your tools to your OpenAI account. Each request signed with the key is measured in tokens and then billed at the rate of the model you called. It's the basic building block for using AI without a subscription. The tool supplies the interface, your key supplies the engine and the provider collects the cost price.
The difference from ChatGPT is worth stating up front. ChatGPT is a chat interface with its own plans. The API key gives access to the same models, but from any application and at your real volume. To produce content with tools it's the natural route, because no middleman takes a margin on your usage.
It's also what sets the key apart from platforms that sell credits. When a tool bills an action in credits, the price includes its margin on the AI. With your own key, the same action costs its list price. Over a month of regular production, the gap shows up on the invoice and not only in principle.
03Step 1. Create the developer account
Go to platform.openai.com, OpenAI's developer console. Sign-up accepts a regular email address or an existing Google or Microsoft account. If you already use ChatGPT, the login details are the same, because it's the same OpenAI account seen from the developer side.
On your first login, the console offers to create an organization and a project. Keep the default values if you work alone, since a "Default" project is plenty to get started. Projects become useful later, when you want to separate uses or clients with one key per project.
04Step 2. Payment method and budget
Before generating the key, go to the "Billing" section to enter a credit card. At the time of writing, OpenAI no longer automatically gives new accounts a trial amount. If an offer shows up when you sign up, take it, but don't count on it. The account then runs on prepaid credit or on pay-as-you-go billing depending on the region.
While you're in these settings, put your safeguards in place right away. The console lets you set a firm monthly spending cap and an email alert threshold. A low cap, €10 for example, comfortably covers content production use. The detailed steps are in the guide to set an OpenAI spending limit, two minutes that make paying per use completely stress-free.
05Step 3. Generate the key
Head to the "API keys" page of the console, the shortest part of the process. It all comes down to four actions. The last one is the only one that won't forgive a lapse of attention. Follow them in this order.
- Open the API keys section from the console menu (in the project settings).
- Click "Create new secret key".
- Give the key a clear name, such as "writing-tool" rather than "key-2". You'll thank yourself when it's time to sort them out.
- Copy the key shown, which starts with sk-. It will never be displayed in full again, so it's now or never.
If you close the window without copying, nothing serious happens. Delete the orphan key and generate another one. A key gets replaced in ten seconds. That quick swap is a healthy habit to keep for later.
06Step 4. Store the key in the right place
An API key commits your credit card, so treat it like a password. Paste it straight into the tool it's meant for, ideally one that keeps it in your browser or encrypts it. Avoid the text file on the desktop, the message sent to yourself and the screenshot, since those are the three most common leaks.
The full topic, with permissions, rotation and what to do when in doubt, is covered in the guide to secure an API key. At the very least, remember the revocation reflex. At the slightest suspicion, delete the key from the console and replace it at once, without touching the account.
07One key per use is the setup that lasts
Nothing forces you to stop at one key. From the second tool onward, the good habit is to create one key per use, with one for the writing tool, one for home-made scripts and one for tests. Each one carries an explicit name and lives its own life.
The benefit shows the day something goes wrong. The console's usage page breaks down consumption, which lets you see which key spends what. If you drop a tool, its key can be deleted without touching the rest. If you suspect a leak, you revoke a single key while the others keep working. This hygiene costs only ten seconds per key at creation time.
For freelancers working with clients, the same principle extends naturally. You set up one project per client in the console, with dedicated keys and usage you can read account by account. Billing at actual cost then becomes a selling point rather than an accounting chore.
08What it costs per use
Billing is per million tokens, with an input price (your instructions) and an output price (the generated text). The table below shows the rates for the common text models, recorded on October 16, 2026 from the official pricing page.
| Model | Input | Output |
|---|---|---|
| GPT-5.5 | $5 | $30 |
| GPT-5.4 | $2.50 | $15 |
| GPT-5.4-mini | $0.75 | $4.50 |
| GPT-5.4-nano | $0.20 | $1.25 |
In real work, a 1,500-word article comes to about 2,500 output tokens. On GPT-5.4-mini, generating it costs a little over one cent. On GPT-5.4 it stays under five cents. Input you've already sent can even be served from the cache for a tenth of its price. At this level, the AI line for an entire blog comes to a few dozen cents a month.
09Connect the key to your tools
The key works right away in any BYOK-compatible tool. At OpenTahr, you paste it into the settings of a free account, where it stays stored in your browser and never on our servers. The twelve tools then work with it, with no AI cost added on our side. The same principle applies elsewhere, because a serious tool always tells you where your key lives.
If you want to connect other engines alongside it, such as Anthropic, Google, Mistral or OpenRouter, the other provider guides follow exactly the same logic of account, billing, key generation and cap. Once you've done the first one, the next ones take three minutes.
10Frequently asked questions
Can you get an OpenAI API key for free?
Creating the key is free but using it isn't, since OpenAI has removed the automatic trial credit for new accounts. If your goal is to try without a credit card, look instead at the free API keys that exist at other providers. The most direct option is to get a free Gemini API key from Google.
How many keys can you create?
Several per project, which is more than enough. Good practice is precisely to create one key per tool or per use, each with a clear name. The day one of them has to be revoked, the others keep working without any interruption to your tools.
I lost my key, how do I get it back?
You won't get it back, because the console never shows a full key again as a security measure. Delete the old one from the API keys page, generate a new one and replace it in your tools. The whole operation takes less than a minute.
Does the same process work for Claude?
The principle is identical, though the console and menu names differ. The full path at Anthropic is detailed in the guide to create a Claude API key, with the same budget and security habits that apply here.
Transparency note. The prices quoted were recorded on October 16, 2026 from OpenAI's official price list (developers.openai.com/api/docs/pricing). They change regularly, so check them before any decision. The trial credit policy varies by period and region, so rely on what the console shows when you sign up.
Want to try these AI models on your own questions, with your own key?
Explore the OpenTahr tools