Setup & EnvironmentLesson 1

OpenAI Account Setup

Module 1 explained what OpenAI is. Here we actually open an account, turn on billing, and create the API key that LangChain will read. Still no LangChain code — only platform clicks.

What you need

An email address you can verify. A phone number is sometimes asked during signup. For API calls you also need a payment method on file — usage is billed per token, not a flat monthly ChatGPT plan. Check current rates on the pricing page before you run large tests.

If you already use ChatGPT for free, that login does not automatically give you API credits. The developer side lives at platform.openai.com — a separate dashboard we covered in Lesson 2.

Create the platform account

Go to platform.openai.com/signup. Google, Microsoft, Apple, or email all work. This is the developer platform — not the ChatGPT chat window at chat.openai.com.

O

Welcome to OpenAI

Sign up or log in to use the API, manage keys, and view usage.

Continue with Google
Continue with Microsoft
Continue with Apple
Continue with email

Already have ChatGPT? Use the same email — the platform account links to it.

Start at platform.openai.com/signup. Chat-only use at chat.openai.com does not create API access by itself.

After login: the home page

Once you sign in, OpenAI opens platform.openai.com/home. The left sidebar lists API keys, usage, and settings. The centre panel shows a short Get started checklist and your current credit balance.

Before you create a key, add credits. On the home page, find the Credit balance card and click Add credits. That opens the plan and checkout flow in the next step.

QList

Home

Create API key

Get started

Add credits
Create an API key
Test models

Total tokens

0

Responses and Chat Completions

0

Time spent

$0.00

Credit balance

$0.00

Add credits

Total requests

After login you land on platform.openai.com/home — click Add credits in the Credit balance card to open billing.

Add billing

After you click Add credits on the home page, OpenAI opens the plan picker below. For this course, Prototype with $5 in API credits is enough — it unlocks full model access for small scripts like the HTML tutorial helper.

Select Prototype, keep the default $5 credits, then click Continue to checkout and add a card. If you already have a balance, top up from Settings → Billing instead. Without payment on file, API requests fail even if you already created a key.

OpenAI PlatformQ
i

Choose your plan

Start experimenting for free or unlock more usage to build your idea.

Free

Experiment with the API to explore your idea.

  • Free
  • Limited access to certain models
  • Usage limits per minute / day
  • Start building for free with the API in Codex and limited access to Playgrounds

Prototype

Build lightweight prototypes to evaluate the API.

  • Starting at $5
  • Access all of our latest models
  • Enough usage to power prototypes and small apps
  • Accelerate building with the API in Codex and Playgrounds

Accelerate

Launch your apps to production with our API.

  • Starting at $50
  • Access all of our latest models
  • Higher usage & rate limits to power larger, production apps
  • Accelerate building with the API in Codex and Playgrounds
$ 5

$5 can cover about 25 million input or 4 million output tokens. Plenty to start building your idea.

Continue to checkout
Plan picker after clicking Add credits — from platform.openai.com/welcome?step=plan. Pick Prototype with $5 for course-sized experiments.

This is not ChatGPT Plus. You are prepaying for API tokens — see current rates on the pricing page.

An example: one key for this course

We will call OpenAI from a small script tied to the HTML tutorial helper idea in Lesson 4. Create one key named langchain-course-dev so you can spot it in the usage logs later.

  1. Open API Keys in the left sidebar.
  2. Click Create new secret key.
  3. Enter the name, leave permissions on All for now.
  4. Copy the full sk-… string when prompted.

Create new secret key

langchain-course-dev
Default project
All
Restricted
Read only
CancelCreate secret key
Pick a name you will recognise later. For this course, langchain-course-dev is enough.
QList

API keys

+ Create new secret key
NameStatusSecret KeyCreatedLast used
langchain-course-dev Activesk-…Na8A7 Jun 2026Never

OpenAI shows the full key once after creation. Copy it immediately — you cannot view it again from this table.

After you close the popup, only the last four characters stay visible.

Store the key locally

Paste the key into a .env file at the root of your project folder. LangChain examples expect the variable name OPENAI_API_KEY. Never commit this file to GitHub or paste the key into a chat message.

.env — project root
# html-tutorial-helper.py reads this file
OPENAI_API_KEY=sk-proj-…your-key-here
Keep the key in a local .env file. Add .env to .gitignore so it never lands in a public repo.

If the key leaks, revoke it on the API Keys page and generate a fresh one. Treat it like a bank PIN — one string, full access to your balance.

What's Next

Account and key are in place. Next: install Ollama and run an open model locally on your PC.