Is an OpenAI API Key Free? How API Billing Works, Free Credit, and How to Read Your Bill
Getting an API key is free, but every call draws down prepaid credit by tokens. How billing works, how to estimate cost before you call, where to check for free credit, and what happens when the balance hits zero.
1. The key is free; the calls are billed
'Is an API key free?' mixes two things. Creating a key costs nothing; it is just a credential. Every call made with it is what gets billed. So the idea of 'buying an API key' is misleading: what you buy is balance, not the key. Third parties that sell 'API keys' are really selling someone else's account quota or a relay service's credit, and you have to judge the source and its stability yourself.
2. How billing works: prepaid, per token, error at zero
You add credit first, and each call draws it down by tokens. When the balance is short, requests fail, commonly with HTTP 429 and an insufficient-quota error code. Note that this 429 does not mean 'too fast' — it means 'no money', so retrying never helps and you must top up. Prepaid credit typically has an expiry and is generally non-refundable; confirm both on the current Billing page. Your rate-limit tier also rises with cumulative spend, which is why brand-new accounts have lower concurrency and tokens-per-minute.
3. Estimating cost before you call
The formula is simple: cost per request = input tokens × input price + output tokens × output price, multiplied by expected calls. Two rules of thumb. Output is usually priced at a multiple of input, so asking the model to say less often saves more than sending less. And English runs at about 1.3 tokens a word while other languages, code and JSON usually cost more tokens, so leave margin. The most accurate method is to run one real request and read the `usage` field in the response. Take the unit prices from the official pricing page, never from an article.
4. Free credit: check, do not rely on rumours
Claims such as 'new accounts get a few dollars free' change with time, region and policy, and many accounts today have none. There is one reliable test: after signing up and verifying, open the Billing or Usage page and see whether any promotional credit and expiry date are shown. If it shows zero, there is none. Do not create multiple accounts to chase free credit; that is a fast way to trigger account risk checks.
5. Reading your bill and usage
The Usage page breaks consumption down by date, model and project, and the Billing page shows balance and top-ups. Two habits pay off: one key per project, so usage splits cleanly and a leaked key can be revoked alone; and a monthly budget cap with a balance alert, so a runaway script cannot drain the account. If you call through a relay, trust its own usage log and reconcile it once against your local counts.
6. Four ways to spend less, in order of impact
First, pick the right model: simple tasks on a small model can cost an order of magnitude less, the biggest lever there is. Second, cap output length with a sensible `max_tokens` and a request for brevity. Third, trim context: do not let multi-turn history grow without limit, and retrieve before sending long documents. Fourth, caching and batch processing: the official API prices repeated prefixes and offline batches differently; check the current documentation for conditions. Do not reverse this order — tuning caching before choosing the right model is optimising the wrong thing.
7. The real obstacle for many users: the top-up
For many developers outside supported card regions the difficulty is not how much it costs but the first payment: the official Billing needs a card the processor accepts, and many local cards are declined by issuing country. Two routes exist. Open a US-issued virtual card and bind it to the official billing (ours has a tested record on OpenAI, though a small first charge is still sensible). Or use an OpenAI-compatible endpoint that takes Alipay or WeChat and bills per use, where your code changes only the base URL. Before choosing a relay, run three checks: list `/v1/models`, compare a capability-sensitive prompt against the official API, and run an open-source checker.
8. A checklist before you start
1. Confirm balance and any promotional credit on the Billing page. 2. Estimate one full task with the formula. 3. Set a monthly cap and a balance alert. 4. One key per project. 5. Run one small request and check the usage field. 6. On a 429, read the body to see whether it is rate limiting or quota. 7. If payment is the blocker, pick a route from our top-up guide.
OpenAI API costs: five things to settle
| Question | Answer | Where to confirm |
|---|---|---|
| Is the key free? | The key is free, calls are billed per token | API keys page in your account |
| How do you pay? | Prepaid credit, drawn down per call | Billing page |
| Is there free credit? | Not guaranteed; trust what your account shows | Billing / Usage after sign-up |
| What at zero balance? | Requests fail (commonly 429 insufficient_quota) | The error response body |
| Cost per request? | Input and output tokens priced separately, by model | Official pricing page plus the usage field in each response |