Your First AI App: The Lab Comes Alive · Lesson 1 ⏱ ~15 min

What an AI app actually is (and what a key unlocks.)

You've talked to Claude in a chat window, and you've talked to it through Claude Code. Both of those are apps someone built — and under every one of them is the same socket in the wall. Today you learn what that socket is, how it's billed, and you get your own plug.

The chat window is not the AI

Here's a thing most people never quite untangle: Claude — the model, the thing that thinks — lives in a data center. The claude.ai website is not Claude; it's a website that talks to Claude. Claude Code is not Claude either; it's a terminal program that talks to the same model. Every AI product you've ever touched — the chatbot on a store's website, the "summarize this" button in some app, the AI feature your bank keeps emailing you about — is a thin costume over exactly one move: a program sends text to a model over the internet, and text comes back. The costume is the product.

The talking happens through an API — which sounds technical and is actually just this: a socket in the wall that programs, not people, plug into. People use screens and buttons; programs use the API. Same building, different door.

claude.ai a website Claude Code a terminal program your game (soon) the API the socket Claude the model, in a data center
Every AI product is a different plug into the same socket. Yours is next.

The meter: what a token is

The API is billed like a utility. The unit is the token — roughly a syllable-ish chunk of text, about three-quarters of a word on average. You pay a tiny amount for every token you send in and every token that comes out, the way a water meter counts liters in both directions. The amounts are genuinely tiny: the model your NPC will run on charges about a dollar per million tokens in, five per million out. A million tokens is roughly ten novels.

Concretely, so you have the number in your head before you ever spend it: one NPC chat message in your game — with everything attached — will cost about a fifth of a cent. The entire course, every conversation and every generated room, lands well under a dollar. The fear is worse than the meter. It almost always is.

🌿Why is API billing separate from your Claude plan? Your subscription is all-you-can-eat for you — one human, typing at human speed. The API is metered because a program plugs into it, and a program could make a million calls while you sleep. Every company that puts AI in a product pays this same meter, which is why "how much does an AI feature cost per use?" is a question professionals ask in meetings constantly. By the end of this course, you'll be able to answer it from experience.

The plan: a roommate for the lab

Here's where the six lessons go. Today: the key. Lesson 2: a tiny server — the "brain in a box" that holds your key and talks to Claude on your game's behalf. Lesson 3: the NPC gets a body and its first live words. Lesson 4: a personality, a memory, and — the good part — knowledge of your actual projects, fed from the same lab-data file you built in Course 02. Lesson 5: the NPC stops just talking and starts doing — walking places, changing things — because you'll teach it to answer in data. Lesson 6: a door appears, and every room behind it is invented by a model on the spot.

One architectural note, because it's the professional heart of this course: your game will never talk to Anthropic directly. It talks to a little server of yours, and the server talks to Anthropic. That's not a training-wheels version of the real thing. That is the real thing — the exact shape of every serious AI product on the internet — and lesson 2 is entirely about why.

Get your key

Time to get your plug. The Claude API lives at console.anthropic.com — sign in there (your regular Anthropic account works; the console is just the developer side of it). Three stops:

1. Billing. Find the Billing section and add credit. The minimum is about $5 — that's the toll for this whole road, and most of it will still be sitting there when the course is over.

2. API Keys. Find API Keys and create one. Name it pixel-lab — future-you, staring at a list of keys, will thank present-you for naming things.

3. Copy it somewhere safe — temporarily. The console shows a new key exactly once. Copy it into a password manager, or a private note you'll delete after lesson 2. Not into your pixel-lab folder, not yet — lesson 2 gives it a proper home with a fence around it.

🌿Screens drift. Consoles get redesigned; if a button isn't where I said, don't hunt through menus — ask Claude Code: "where do I create an Anthropic API key?" It knows the current layout better than any screenshot I could take.
🔑The one rule of keys: treat this string exactly like a credit card number, because that's what it is. Anyone who has it can spend your credit. It never goes in a chat message, a screenshot, a text to a friend, or — hold this thought hard for next lesson — a git commit. And if it ever does leak: don't panic. The console has a revoke button, and a new key takes ten seconds. Professionals leak keys sometimes too; the skill isn't never dropping it, it's knowing where the revoke button is.
Checkpoint — you should be looking at this
API key created

  sk-ant-api03-XXXXXXXX...XXXX

  ⚠ Copy this now. For security reasons,
    you won't be able to see it again.

Closed the window before copying? → No harm done. Delete that key, create another. Keys are free — only the credit costs money.

💾No save point tonight — for once. You haven't touched the project folder, and the one thing you did make must never be committed anywhere, ever. Making absolutely sure of that is literally the first job of lesson 2.

You can now…

  • Say what an API is in one sentence — and spot one behind every app you use
  • Explain tokens, and why API billing is a meter while your Claude plan is a buffet
  • Hold an API key with appropriate paranoia, and know where the revoke button lives
  • Name the three-part architecture of every AI product: frontend → your server → model

That vocabulary — API, token, key, "who holds the key?" — is the working language of every AI product meeting on Earth. People are paid handsomely to ask those questions. You now understand all of them, and tomorrow you build the answer.

Want the course by email? Lessons in your inbox, plus new ones as I write them.

Running a business and would rather this get built for you? That's literally my job — start with the free audit.