Home / Passwords & API keys / API keys, one company at a time / OpenAI API key
OpenAI API key
Updated Sep 18, 2026
platform.openai.com, not chatgpt.com. Plus is not API access. OPENAI_API_KEY in .env.
You will leave with OPENAI_API_KEY in .env and in Vercel. ChatGPT Plus does not include API calls. The chat app and the API are different products on different dashboards.
Step 1: The API site, not the chat site
Go to platform.openai.com and sign in. Do not hunt for a key on chatgpt.com. There isn’t one there.
Step 2: Billing, then a key
Settings → Billing. Add a payment method or buy a small credit ($5 is enough to test). Without this, a key exists and every request still 401s.
Then API keys → Create new secret key. Name it after the repo. Copy it once. It used to start with sk-; project keys look like sk-proj-.... You will not see the full value again.
Step 3: Two files, one name
.env.example:
OPENAI_API_KEY=
.env:
OPENAI_API_KEY=sk-proj-your-real-key
No NEXT_PUBLIC_. Vercel → same name → Production → redeploy.
Tell the agent to read .env.example and not to ask for the value.
Gemini instead? Gemini API key. Anthropic? Claude API key.
Checklist
Saved in this browser. No account. Clearing site data wipes it.
Next: Gemini API key · Claude API key
Get new guides and videos by email
One email when something new is up. No spam. Unsubscribe anytime.