Home › APIs › OpenAI

OpenAI API — pricing, free tier & how to get a key

OpenAI's API powers the new flagship GPT-6 Astra (launched September 3, 2026), the GPT-5.6 family (Sol/Terra/Luna), GPT-4o 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.

OpenAI API pricing (reference, October 2026)

ModelInput $/1MOutput $/1MBest for
GPT-6 Astra $10.00$50.00Deepest reasoning, highest cost
GPT-6.1 Sol $2.00$10.00Cheaper than GPT-5.6 Sol's own discount rate
GPT-6 Luna $0.10$0.50Default for routing/classification/extraction
GPT-5.6 Sol promo$4.00$20.00Temporary discount rate, through at least Nov 21, 2026
GPT-5.6 Terra$2.00$12.00Flagship reasoning + generation
GPT-5.6 Luna$0.20$1.20Superseded by GPT-6 Luna above
GPT-5 nano cheapest legacy$0.05$0.40Highest volume, simple tasks
GPT-4o$2.50$10.00Vision, still widely used
GPT-4o mini$0.15$0.60Cheap legacy workhorse
o3$2.00$8.00Hard reasoning (repriced)
⚠️ Reference prices, October 2026 — OpenAI updates pricing regularly. GPT-6.1 Sol and GPT-6 Luna confirmed on OpenAI's official pricing page this week, priced below the GPT-6 Astra flagship launched September 3, 2026. All GPT-6-family rates above apply to requests up to 272K input tokens — past that threshold input roughly doubles and output rises 50% on every tier (see our GPT-6.1 Sol/Luna breakdown). GPT-5.6 Sol's $4.00/$20.00 rate is an explicitly temporary promotion through at least November 21, 2026. Confirm on openai.com/api/pricing before budgeting. Prices are per 1M tokens; output is billed separately and costs more. · Report outdated price →
✓ Last verified: 2026-10-25· Source: official provider pricing page· Auto-monitored — report change →

→ Estimate your bill with the GPT-6 Astra API cost calculator (with a GPT-5.6 Sol savings comparison), the GPT-4o API cost calculator, or compare every model on the full AI API cost calculator.

Is there a free tier?

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-5 nano, 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.

How to get an OpenAI API key (step by step)

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:

# quick test (replace $OPENAI_API_KEY)
curl https://api.openai.com/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'

Estimate your cost

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.

Cheaper alternatives

If GPT-6 Astra is more than you need — and for most everyday chat, summarization or extraction it is — drop to GPT-5.6 Sol (2.5× cheaper) or all the way to GPT-5.6 Luna / GPT-5 nano (≈15–100× 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.

FAQ

Is the OpenAI API free?

No permanent free tier. New accounts may get small trial credits that expire; ongoing use is pay-as-you-go. GPT-5 nano is the cheapest model at ~$0.05/1M input tokens.

How do I get an OpenAI API key?

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.

Which OpenAI model is cheapest?

GPT-5 nano — $0.05/1M input, $0.40/1M output — roughly 3× cheaper than GPT-4o mini and 100× cheaper than the GPT-5.6 Sol flagship, and good enough for most classification, extraction and simple generation tasks.

Why is output more expensive than input?

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.

Host your project:DigitalOcean — $200 free ↗Hostinger VPS
LLM Price Drop Savings CalculatorBlended LLM Price CalculatorKnowledge Base Re-Embedding Cost CalculatorLLM A/B Test CostLLM Token Cost Calculator

Tools & Hosting

📈 TradingView🔒 NordVPN💳 RevolutDigitalOcean $200HostingerMeshy AI📧 Icemail