Getting an OpenAI API Key
An OpenAI API key takes a few minutes to create, but there's one step that trips people up (billing). Here's the exact path, plus a cheaper way to call GPT if that's your real goal.
Step by Step
- Go to platform.openai.com and sign up / log in.
- Open Settings → API keys (or View API keys under your profile).
- Click Create new secret key, name it, and copy it. It's shown only once — store it in a secrets manager or
.envimmediately. - Add billing: go to Settings → Billing and add a payment method / prepaid credits. Without credits, calls fail with a quota error.
There's no meaningful ongoing free tier — you need credits to make live calls.
Common Gotchas
- "You exceeded your current quota" almost always means no billing/credits added, not a rate limit.
- Keys are secret — never commit to Git or ship in a client app (proxy via your backend, see AI API for mobile apps).
- Use project-scoped keys and separate keys per environment so you can revoke without breaking everything.
The Cheaper Way to Call GPT
If you just want GPT in your app, you don't have to manage OpenAI billing separately. Through LinkModel, one key calls the full GPT-5.x family plus Claude, Gemini and DeepSeek — up to 30% below official rates, price shown before each call:
curl -X POST https://api.linkmodel.ai/v1/chat/completions \
-H "Authorization: Bearer $LINKMODEL_API_KEY" -H "Content-Type: application/json" \
-d '{ "model": "gpt-5.5", "messages": [{"role":"user","content":"Draft a release note: ..."}] }'Switch to GPT-5.4 or GPT-5.3-codex with a one-word change. Full rates in the GPT API pricing guide. Confirm the chat endpoint in the docs.
Which GPT to Use
- Flagship → GPT-5.5 ($5/$30)
- Balanced default → GPT-5.4 ($2.50/$15)
- Cheapest → GPT-5.4 Nano ($0.20 input)
- Coding agents → GPT-5.3-codex
Cut the Bill
Route bulk work to a cheap tier and cache your stable prompt prefix — details in how to reduce AI API costs and prompt caching.
Bottom Line
Create an OpenAI key on platform.openai.com and add billing to make it work. For production, you can skip per-provider billing and call GPT (and everything else) through one cheaper key. Need Gemini or Claude too? See how to get an API key.
Start free with a $1 credit — no billing setup required.
