Does an OpenAI API Key Cost Money? How Billing Works
Does openai api key cost money? Creating a key is free on most platforms; what costs money is the tokens you send through it. Here is how that billing works, and how prepaid credit keeps the bill predictable.
Last updated
Summary
- A key is only a credential. Charges come from the tokens you use with it.
- Prepaid credit caps your exposure: a leaked key can spend only what is on the balance.
- On our API the $0.50 trial covers roughly 1,400 short chat requests, with no card.
- You can check your balance at any time with one GET request or a response header.

Table of contents
A key is a credential, not a product
An API key is a long secret string. It tells the server who is calling, so the server knows whose balance or invoice to charge. Generating one does not buy anything. Think of it like a login token: having it costs nothing, using it does.
So when people ask whether an OpenAI-style API key costs money, the useful answer has two parts. The key itself is normally free to create. The requests you make with it are billed by tokens, and the rate depends on the model and the provider. For any specific vendor, check their current pricing page and their current rules on free credit, because both change.
The distinction matters for planning. A key sitting unused in a config file costs nothing. A key inside a busy app costs whatever that app sends.
What you actually pay for: tokens
Text models bill by token, roughly three quarters of an English word each. Providers split the price in two: input tokens (your prompt, plus the chat history you resend) and output tokens (the reply). Output is usually priced higher because generating text takes more compute than reading it.
Two habits inflate bills without anyone noticing:
- Resent history. In a chat, every new message carries the earlier messages again. A 30-message conversation pays for the early messages many times over.
- Unbounded replies. If the model writes long answers and nothing limits them, output tokens add up fast.
Our own rates are simple: $0.15 per 1M input tokens and $0.50 per 1M output tokens, for one model, with no subscription. Failed or refused requests are not charged. The full table is on the pricing page.
Prepaid credit versus billing after the fact
Providers collect money in two ways. Some bill you afterwards, based on usage during the month. Others, including this API, ask you to load credit first and draw it down.
| Model | How it works | Risk if a key leaks |
|---|---|---|
| Prepaid credit | You top up, requests spend the balance | Limited to the remaining balance |
| Billed afterwards | Usage accumulates, an invoice follows | Can grow until you notice or hit a cap |
Prepaid is easier to reason about. You decide the maximum in advance, and when the balance reaches zero, requests simply stop. The trade-off is that you must remember to top up. Our credit never expires, so there is no pressure to spend it by a deadline.
How the trial and top-ups work here
New users can claim $0.50 of trial credit with one click on the API key page after signing up with Google or with email and password. It is one per person, valid for 7 days, and needs no card. A trial key allows 2 concurrent requests and 60 requests per minute, which is enough to test an integration.
When you want more, top up any whole amount from $20 to $500. Larger top-ups include a bonus: +5% from $50, +10% from $100 and +15% from $200. So $100 gives you $110 of credit, and $200 gives you $230. Payment is in crypto only, using USDT on TRC20 or USDC on Base.
A full key allows 8 concurrent requests and 300 requests per minute.
What $0.50 of trial credit buys
Numbers help here. Take a typical chat request with 1,000 input tokens and 400 output tokens:
- Input: 1,000 / 1,000,000 x $0.15 = $0.00015
- Output: 400 / 1,000,000 x $0.50 = $0.0002
- Total per request: $0.00035
Divide $0.50 by $0.00035 and you get about 1,428 requests. In other words, the trial can cover well over a thousand short exchanges, enough to run a real test of your app rather than a single hello world.
Prompts that carry a long history cost more. A request with 10,000 input tokens and 400 output tokens costs $0.0015 + $0.0002 = $0.0017, so the same $0.50 gives about 294 of them.
Check your balance from code
You never have to guess what is left. Every response carries an X-Balance-USD header, and two endpoints return the balance directly. Replace YOUR_KEY with your key.
# OpenAI-style credit endpoint
curl https://api.pricingkeyapiopenai.com/v1/dashboard/billing/credit_grants \
-H "Authorization: Bearer YOUR_KEY"
# Simple balance endpoint
curl https://api.pricingkeyapiopenai.com/v1/balance \
-H "Authorization: Bearer YOUR_KEY"
# Balance header on a normal request
curl -i https://api.pricingkeyapiopenai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"uncensored","messages":[{"role":"user","content":"Say hi"}],"max_tokens":20}'
Look for X-Balance-USD in the response headers. Logging it after each call is a cheap way to trigger a low-balance alert in your own monitoring.
Where surprise charges come from
When someone says a key "cost them money," the cause is usually one of four things, none of them the key itself.
- A chat subscription is not API credit. Consumer chat plans and developer API usage are normally billed separately. Paying for one does not fund the other. Check each provider's current terms.
- Free credit has conditions. Promotional credit, when offered, tends to be small and to expire. Plan as if it will not be there, and treat it as a bonus for testing.
- Retry loops. A script that retries a failed call without a delay can send hundreds of requests in a minute. On a pay-per-token service every successful retry is billed. Add a wait between attempts and a maximum count.
- Agents that call themselves. A tool-using loop with no step limit can burn through a balance overnight. Cap the number of turns.
A realistic month helps put these in proportion. Say a hobby app handles 300 chats a day, each using 2,000 input tokens and 350 output tokens. Daily input is 600,000 tokens, which costs 0.6 x $0.15 = $0.09. Daily output is 105,000 tokens, which costs 0.105 x $0.50 = $0.0525. The day comes to $0.1425, so a 30-day month is $4.275, a little over $4. A single runaway loop could cost more than that in an hour, which is why caps matter more than rates.
The same applies to testing. Before you point a new script at a funded key, run it against the trial balance and watch the X-Balance-USD header move. If the number drops faster than your estimate, find out why before scaling up.
Keeping a key from costing more than planned
Most surprise bills come from habits, not from pricing. A short checklist:
- Store the key in an environment variable, never in client-side code or a public repository. The common API key integration mistakes article covers the usual leaks.
- Set
max_tokenswhere replies should stay short. It is optional here, since a completion can use the rest of the 100,000-token window, so a cap is your own guardrail. - Trim chat history before resending it.
- Reissue the key on the key page if you suspect exposure. The old key stops working at once, and no support ticket is needed.
- After a top-up, create separate labeled keys for separate apps (up to 5), so you can revoke one without touching the rest.
Setup details for the SDKs are in the docs.
More guides
Common questions
Is generating an API key free?
On most platforms, yes. The key is only a credential, and you are billed for the tokens used with it. Check each provider's current pricing and free-credit rules, since they change.
Do I need a card to try this API?
No. The $0.50 trial is claimed with one click on the API key page, needs no card, and is valid for 7 days. Paid top-ups are made in crypto.
What happens when my balance runs out?
Requests stop being served until you top up. Credit never expires, so unused balance stays on the account.
Am I charged for failed requests?
No. Failed or refused requests are not charged.
Generate your API key
Sign up, retrieve your token, update your base URL. That is the entire configuration.