Home/Insights/Data Engineering

How to Create an OpenAI API Key & Set Up Billing (Full Step-by-Step Guide)

By Ani BjörkströmPublished 9 August 2025Reviewed 17 November 20262 min video + articleData Engineering

How to Create an OpenAI API Key & Set Up Billing (Full Step-by-Step Guide)
▶ Watch the full 2-minute video · with chapters & transcript

AI TOOLS

How Do You Create an OpenAI API Key and Set Up Billing Correctly?

In short: Everything happens on platform.openai.com: account creation, API key generation, billing setup and organization ID all live in the same dashboard.

Key takeaways

  • Everything happens on platform.openai.com: account creation, API key generation, billing setup and organization ID all live in the same dashboard.
  • Copy your secret key immediately after creating it — it is shown only once and must never be shared publicly.
  • Set a budget limit and an email alert (the tutorial uses an $8 alert) so API usage can never silently drain your payment card.

In this step-by-step guide, Ani Björkström covers the four things every new OpenAI API user needs: creating an account, setting up billing, generating an API key, and finding the organization ID.

How do you create an OpenAI platform account and API key?

Go to platform.openai.com and click "sign up", or "log in" if you already have an account; with a Gmail address, "continue with Google" authenticates you directly without typing your name or email. Once inside, type "API key" into the left search bar, click "create new secret key", name it, select the default project, and create it. Copy the key right away — you will not be able to see it again later — and never share it publicly.

How do you add billing and control your spending?

New users must add payment details before the API works. Search for "billing overview", open "payment methods", and add your credit or debit card. Then, under "overview", define how much money the API may draw from your account: "edit budget" sets a limit, and alerts notify you by email — in the tutorial's setup, an alert fires as soon as usage reaches $8.

Where do you find your organization ID?

The organization ID sits under "General" on the left side of the platform. Open that section and copy the ID from its field. The full setup order is summarized below.

StepWhereAction
1. Accountplatform.openai.comSign up, ideally with "continue with Google"
2. API keySearch: "API key"Create new secret key, copy it immediately
3. BillingSearch: "billing overview"Add payment method, set budget and alerts
4. Organization IDGeneral settingsCopy the organization ID

FAQ

Can I view my API key again after creating it?

No. The key is shown once at creation, so copy it right away.

Do I need a payment card before using the API?

Yes. New users must add a credit or debit card under billing before API calls will work.

How do I stop the API from overspending?

Use "edit budget" to cap spend, and create an email alert — for example at $8 — so you are warned early.

Want this working inside your finance team?

Ani Björkström

Ani Björkström — founder of QvantX Sweden AB, a Stockholm consultancy building AI solutions for banks, asset managers and finance teams. Anthropic partner. Every article starts from a real client build, minus the confidential parts. LinkedIn →