OpenAI's API powers GPT-4o, GPT-4o mini and the o-series reasoning models — the most widely used large-language-model API in production. Here's what it costs, what you get for free, and exactly how to get your key.
| Model | Input $/1M | Output $/1M | Best for |
|---|---|---|---|
| GPT-4o | $2.50 | $10.00 | Quality generation, vision |
| GPT-4o mini cheapest | $0.15 | $0.60 | Most tasks, high volume |
| GPT-4.1 | $2.00 | $8.00 | Long context, coding |
| GPT-4.1 mini | $0.40 | $1.60 | Balanced cost/quality |
| o3 | $10.00 | $40.00 | Hard reasoning |
OpenAI has no permanent free tier for the API. New accounts occasionally get a small amount of trial credit that expires, but ongoing usage is pay-as-you-go. The good news: the cheapest model, GPT-4o mini, is so inexpensive that light projects often cost a few cents per day. Want a real free tier instead? See Google Gemini, which offers a generous free quota on AI Studio.
1. Go to platform.openai.com and create an account (or sign in).
2. Open Settings → Billing and add a payment method. The API won't work without billing set up.
3. Go to the API keys page (platform.openai.com/api-keys).
4. Click Create new secret key, give it a name, and copy it — you can only see it once.
5. Set a monthly usage limit under Billing → Limits so a runaway script can't surprise you.
Test it with a simple request:
Use the AI API Cost Calculator to plug in your token counts and request volume — it shows your monthly cost and ranks every model (including Claude and Gemini) from cheapest to most expensive for your workload.
If GPT-4o is more than you need: drop to GPT-4o mini (≈15× cheaper) for most tasks; or compare Claude Haiku and Gemini Flash, which target the same low-cost, high-volume niche. For the absolute cheapest, DeepSeek-V3 undercuts most US providers.
No permanent free tier. New accounts may get small trial credits that expire; ongoing use is pay-as-you-go. GPT-4o mini is the cheapest model at ~$0.15/1M input tokens.
Create an account at platform.openai.com, add billing, open the API keys page, click Create new secret key, copy it once, and set a monthly usage limit.
GPT-4o mini — roughly 15–20× cheaper than GPT-4o and good enough for most classification, extraction and simple generation tasks.
Generating tokens is more compute-intensive than reading them, so output is billed at 3–5× the input rate across providers.
Not affiliated with OpenAI. Prices are reference estimates — always verify on the official pricing page.