// coursework

Coursework

Structured tracks for learning AI — built from the same material I'm testing, written for people starting from zero.

← back to the notebook

// your progress

// the tracks

The tracks

track 01 / foundations

How AI actually works

Plain-language fundamentals: what these tools do, where they break, and what "prompt" really means. Beginner-friendly, no math required.

→ Nine lessons, start here

track 02 / workflows

Working with AI, day to day

Practical workflows — asking clearly, checking output, knowing when not to trust it, and building habits that survive new tools.

track 03 / experiments

Run it, log it

Guided experiments tied to the field log: replicate the test yourself, record your own result, and add it to the notebook.

Track 01 is live below. Tracks 02 and 03 are being written — they'll land here as they're finished, dated like everything else on this site.

// track 01 · foundations

Foundations

Nine lessons on the machinery under every AI tool. No jargon left unexplained, no steps skipped. Read in order the first time; jump around after that.

lesson 01

What is an API?

API stands for Application Programming Interface. Strip the words down and it means: a defined way for one piece of software to talk to another. It's not a product you buy — it's a contract. One side promises "ask for things in this format, and you'll get answers in that format." The other side makes the ask.

Your program Service request response
An API sits between two programs: yours sends a request, the service sends a response. You never see the kitchen — just the menu.

On the internet, APIs are how almost everything works. Your weather app doesn't invent forecasts — it calls a weather service's API. Your banking app checks your balance through an API. A game fetches the leaderboard through an API. In practice it's a plain request over HTTPS to a URL (called an endpoint), carrying your question, and a response carrying the answer — usually as JSON, which is just structured text a program can parse.

// check-in01 Your weather app shows today's forecast it didn't compute. Where did the numbers come from?

// your turn

Pick one app on your phone that shows live data (weather, scores, deliveries). In two sentences: what does it ask for, and who answers?

Show an example

A weather app asks a weather service's endpoint one thing — "forecast for my location today?" — and draws what comes back. What it asks for: the forecast. Who answers: the weather service's API, not the phone.

lesson 02

What is a provider?

A provider is a company or service that runs AI models and sells you access to them over an API. They own the servers, the GPUs, the billing system, and the key management. You send requests, they send answers, they charge by usage.

Provider A sells access, bills you (the restaurant) Provider B sells access, bills you (another menu) Model X one dish both serve the same model
Provider is who serves it; model is what's served. One provider serves many models, and one model can sit on many providers' menus.

Keep two words straight, they get mixed up constantly:

  • Provider — who serves it. (The restaurant.)
  • Model — what's being served. (The dish.)

One restaurant serves many dishes, and one dish can appear on many menus — open-weight models can be hosted by their original maker or by other companies.

// check-in02 Same model, served through OpenRouter instead of its original maker. What changed?

// your turn

Two AI tools you've heard of — one question each: which model runs inside them, and who's the provider serving it?

Show an example

Tool A: model is whatever its dropdown names (say a mid-size chat model), provider is the company behind that dropdown. Tool B: same two questions — and if it's OpenRouter underneath, the provider is OpenRouter, even though the model's original maker didn't serve it.

lesson 03

What is a model?

The model is the thing itself: a large trained neural network that takes text in and produces text out. It's what people mean by "AI" in "AI tool" — everything else on this track is infrastructure around it.

How it works, honestly and without magic: a language model is an enormous pattern-matcher trained on mountains of text, learning to predict what chunk of text plausibly comes next. Ask it a question, and it generates an answer one piece at a time, each piece chosen by probability. "Autocomplete on a colossal scale" is reductive, but it's the right intuition to start from.

your text in the model predicts what comes next answer piece 1 piece 2 piece 3 … out, one at a time
The model is a pattern-matcher: text goes in, it predicts what comes next, and the answer appears one piece at a time — never a lookup.

Two consequences fall straight out of that design, and they explain most of what confuses beginners:

  • It doesn't look things up — it generates plausible continuations. When plausibility and truth diverge, you get a hallucination: stated with total confidence, and wrong.
  • It has a knowledge cutoff — a date after which its training data simply stops. It doesn't know what happened last week unless you or a tool hand it that information.

Models are versioned. Providers ship updates under new names, retire old ones, and the names carry version markers. When a tool shows a model dropdown, each entry is one of these versions — and switching entries changes capability, speed, and price.

// check-in03 In an AI tool, which one is the model?

// your turn

Think of the last confidently wrong answer an AI gave you. Why did it happen — no lookup, or a knowledge cutoff? Write both causes in your own words.

Show an example

"No lookup" means it generated a plausible answer instead of checking — that's a hallucination, wrong and confident. "Knowledge cutoff" means the fact is real but post-dates its training data, so it simply can't know it. One is invention, the other is a date the model can't cross.

lesson 04

What is an API key?

An API key is a long, secret string of characters that identifies you to the provider. Every request you send carries it, and it does two jobs: it proves who's asking, and it points the bill at your account.

Your request key: sk-… Provider checks "who's asking?" Your bill charged here
The key travels with every request: it proves who's asking, and it points the bill at your account — which is why it acts like a bar tab.

The rules, and they're all one rule: the key is you.

  • Never hardcode it into code. Code gets shared — pasted into chats, pushed to GitHub, shown in tutorials. Assume anything in source code becomes public.
  • Never paste it anywhere textual — chat logs, issue threads, screenshots, terminal recordings, streams. The classic leak is a key visible in a shared screenshot for eleven seconds.
  • Keep it in an environment variable (lesson 05), not in your files. Code holds the name of the variable; the secret stays outside.
  • If it leaks: revoke it first, ask questions after. Deleting the line from your file changes nothing — assume it's compromised, kill it in the provider's console, generate a new one.
  • One key per project. Kill a compromised key without breaking everything else — and you can tell which project is spending what.

What actually goes wrong when a key leaks: automated scanners find it — often within minutes — and start sending requests against your account, burning your credit until someone notices. Provider consoles let you set spend limits on keys; set them before you need them (lesson 09).

// check-in04 Your key leaks into a public repo. What happens first?

// your turn

Write the three rules of keys from memory — no scrolling up. Then add one place you'd never paste one, from your own life.

Show an example

Never hardcode it into code, never paste it anywhere textual, keep it in an environment variable — and if it leaks, revoke first and ask after. One place I'd never paste one: a terminal screenshot posted to a chat for help. That's the eleven-second leak the lesson warns about.

lesson 05

What is an environment?

This word carries two meanings in daily use, and beginners get tangled because nobody flags that they're different things. Learn both — you'll meet both.

Meaning one: an environment is where software runs. Your laptop is an environment; a cloud server is an environment. Teams habitually label them — development (you, experimenting, breaking things freely), staging (a rehearsal copy), production (where the public is, do not experiment here). The point of separate environments is that config differs between them: development might use a free test key; production uses the real one with real limits.

Meaning two: environment variables are named slots of configuration your programs inherit from the system. Think of them as labeled bottles sitting in the process's environment — the OS fills them, every program that runs can read them. One bottle might be named OPENAI_API_KEY and hold your secret. Your program reads the bottle by name; the secret itself never appears in the code.

your environment OPENAI_API_KEY MODEL_NAME reads your program gets the value by name open a new terminal → that environment is empty again
Config lives in the environment as named slots; code reads the name, never the secret — and each new terminal starts from an empty set.

This is why every setup guide says "export your key" or "add it to your environment." It's the wall between the two kinds of information:

  • Code — shareable, committed to git, shown to the world.
  • Config — secrets, per machine, never committed.

One more piece of vocabulary: .env files. Developers keep a small local file listing a project's environment variables — one line per bottle — so they don't retype them every session. Two habits make this safe: .env goes in .gitignore so it never travels to GitHub, and a template file like .env.example lists the names with placeholder values so teammates know which bottles to fill.

// check-in05 You set your key in one terminal, then open a fresh one — the key's gone. Why?

// your turn

List the environment variables you'd set for your first AI project — names only, no secrets. Which one goes in .gitignore, and why does .env.example exist?

Show an example

OPENAI_API_KEY, MODEL_NAME, BASE_URL — three bottles, no values written here. The file holding them, .env, goes in .gitignore so it never travels to GitHub. .env.example exists to list the names with placeholders, so a teammate knows which bottles to fill without seeing anyone's secret.

lesson 06

What is a prompt?

A prompt is the text you send to the model — your side of the conversation. Nothing more mystical than that. It's what lesson 03's autocomplete reads before guessing the next piece.

What you type is rarely the whole prompt, though. Real tools send a stack:

  • System prompt — standing rules written by the app: who the assistant is, how to behave, what to refuse. You don't see it, but it's why the same model feels different in two different tools.
  • Conversation history — everything said so far, replayed each turn (which is why history matters and why tokens add up).
  • Your message — this turn's instruction.
your message (this turn) conversation history (replayed) system prompt (standing rules) the whole stack goes up — the model sees all three, every turn
The prompt is a stack: standing system rules, the replayed history, then your message — the model receives all three, not just what you typed.

What makes a prompt actually work comes down to three ingredients:

  • Context — the background the model can't guess: who's the audience, what's already been tried, what the constraints are.
  • Specificity — the exact ask. "Make it good" means nothing; "cut it to three bullets, plain language, no marketing words" means everything. Example beats adjective — show one paragraph you like and say "like this."
  • Output shape — the format you want back: a list, a table, code only, under 100 words. Say it and you won't have to redraft.
// check-in06 What does the model actually receive when you hit send?

// your turn

Take one vague ask you've actually made ("make it good" territory) and rewrite it with context, specificity, and an output shape. Two sentences max.

Show an example

Vague: "Make this summary good." Rewritten: "This is for a busy founder who skims — cut my notes to three bullets, plain words, no marketing phrases, and keep the one number that matters." Context (who's reading), specificity (three bullets, no marketing words), output shape (a short list).

lesson 07

What is a token?

A token is the unit models actually work in. Before anything runs, your text gets chopped into subword chunks — tokens — and every limit, every price, every "the AI forgot" moment traces back to counting them.

Common words fit in one token; unusual or long words split into several. A workable rule of thumb for English: one token ≈ ¾ of a word — so 100 tokens is roughly 75 words. It's a thumb, not a law; but it gets you in the neighborhood whenever you're reading a bill or a limit.

"Hello there, unbelievable" Hello there , un believ able each chip ≈ one token — cut points aren't always whole words 100 tokens ≈ 75 words
The model never sees your sentence whole — it sees chips. Common words stay intact; odd ones split, and every chip counts on the bill.

type a sentence — approximately how models slice text:

≈ 5 tokens — the static example: “Hello there, my friend”

  • Hello~1 token
  • there~1 token
  • ,~1 token
  • my~1 token
  • friend~1 token

    Two numbers that suddenly make sense once you know tokens:

    • Context window — how many tokens fit into the model's working memory at once: your message, the whole history, everything else in the request, minus the room reserved for its reply. Run past it and either the oldest content gets dropped or the request is rejected — either way, that's "why did it forget what we said twenty messages ago."
    • Price — providers bill per input token (what you send) and per output token (what it writes), usually with output costing more per token. Long prompts plus long answers multiply, and suddenly the metered feeling of AI billing is obvious.
    // check-in07 You send 400 words and get 600 back. Roughly how many tokens is that?

    // your turn

    Open your favorite chat AI, ask it "estimate the token count of this message, then answer," and write down its guess. Correct for the ¾ rule — how close was it?

    Show an example

    You type a 40-word message, and it guesses 160 tokens. The ¾ rule says 40 × 0.75 ≈ 30 tokens — so its guess is high by more than 5×. Models are unreliable counters of their own text; that's exactly why the thumb rule exists. Close enough to budget, never close enough to bill.

    lesson 08

    How one request actually flows

    Every lesson above is a station on one line. Here's the whole journey — you type a message, and about a second later words appear on screen:

    1 2 3 4 5 6 7 build key send check generate stream render when something breaks, walk the line in order
    Seven stations, one line — the station that fails tells you what to check first.
    1. The app builds the request. Your message joins the system prompt and the conversation history. (Lessons 06, 01.)
    2. It reads your key from the environment — the bottle named OPENAI_API_KEY — and attaches it to the request. The secret never sat in the code. (Lessons 05, 04.)
    3. It sends the request — one HTTPS call to the provider's endpoint. (Lessons 02, 01.)
    4. The provider checks the key, confirms the account exists and has quota left, then routes the request to the model running on their servers. (Lessons 04, 02, 03.)
    5. The model generates — tokens produced one after another, not all at once. (Lessons 03, 07.)
    6. The response streams back — that smooth "typing" effect you've watched a hundred times is exactly this: tokens arriving as they're made, not a message held back until it's finished.
    7. The app renders it, records the token usage, and the provider's meter adds input and output tokens to your bill. (Lesson 07.)

    That's the full loop, end to end. Every entry in the field log on this site started as a request shaped exactly like this one — and when one broke, the debugging was walking this list in order: key? endpoint? quota? model? output?

    // check-in08 An AI tool answers with "invalid API key." Which station on the line rejects it?

    // your turn

    An AI tool hangs and never replies. Rank the seven steps above in the order you'd check them — first suspicion at the top — and say why.

    Show an example

    1 — the request itself: is it even being built, or did the app throw before sending? 2 — the key: read from the right environment, not an empty one? 3 — the send: endpoint reachable? Then 4 (quota), 5 (model), 6 (stream), 7 (render). Early steps are cheaper to rule out and are where hangs usually start.

    lesson 09

    Keeping your keys and your bill safe

    Lesson 04 covered what a key is. This is the standing routine — boring on purpose, because everything here is the cheap version of a very expensive mistake.

    Cap the spend hard limit, set early before anything's wrong One key per project key A key B kill one, nothing else dies Check usage weekly find spikes on a Tuesday
    The standing routine: cap the bill, keep keys isolated, watch the dashboard — all three are the cheap version of an expensive mistake.
    • Set a spend limit before real use. Every provider console has caps — daily or monthly hard limits. A key with no cap is a key that can spend without you. Set the cap while nothing's wrong.
    • One key per project, revoke freely. Rotation is routine, not an emergency drill. If you even suspect exposure, kill the key — a false alarm costs two minutes.
    • Check the usage dashboard weekly until you trust your setup. A surprise spike means one of two things: runaway code, or someone else has your key. Either way you want to find out on a Tuesday, not on an invoice.
    • 429 means slow down, not broken. That's a rate limit — the provider asking for fewer requests per minute. Back off and retry later; hammering it changes nothing.
    • Screenshot discipline. Before sharing any terminal, config, or log: scan it for key-shaped strings. Blur or don't share. This one habit prevents the most common leak there is.
    • Privacy is part of safety. Whatever you send to the API is visible to the provider. Check retention settings, and never send credentials or data you're not allowed to share — including in prompts "just to test."
    • Free tiers are for learning — they exist so you can do exactly what this track teaches without risk. Use them until the setup is habits, then scale.
    // check-in09 Your usage spikes overnight, no new code from you. What are the two suspects?

    // your turn

    Open your provider console and find where spend limits live (or where they would). Write the cap you'd set and one habit from this lesson you'll keep.

    Show an example

    Cap: a hard monthly limit of whatever I'd be sad to lose — set while nothing is wrong, not during an incident. Habit: a weekly glance at the usage dashboard, because a surprise spike means runaway code or someone else has my key, and I'd rather find out on a Tuesday than on an invoice.

    recap

    Every term in one line

    • API — the contract that lets software talk to software.
    • Endpoint — one address on that contract; you ask here.
    • Provider — the company that runs models and sells access.
    • Model — the trained network that turns text into text.
    • Prompt — the text you send: system rules, history, your ask.
    • API key — your secret identity, and the tab your usage is billed to.
    • Environment — where the code runs; environment variables — named config slots it inherits, where keys are supposed to live.
    • Token — the chunk models read, count, and bill by (≈ ¾ of a word).
    • Context window — how much fits in working memory at once.
    • Streaming — tokens arriving as they're generated; the typing effect.

    Track 02 (workflows) and 03 (experiments) build on these — same vocabulary, put to work.

    checkpoint

    Test yourself

    Ten questions, one for each idea worth keeping from the nine lessons. Pick an answer and you get the verdict on the spot, with the one-line reason. Nothing is stored or sent anywhere — this page still has no trackers.

    JavaScript isn't running, so this quiz can't mark itself. The questions below still work as reading practice — and the answers are the ones marked in each lesson.

    01 Software talks to software — what is an API, in one line?

    02 “Provider” and “model” — which pair has it right?

    03 Why does a model state something false with total confidence?

    04 An API key is most like…

    05 You spot your key in a screenshot you already posted. First move?

    06 Where is an API key supposed to live?

    07 Which ask is most likely to get you what you actually want?

    08 Rule of thumb: 100 tokens of English is about…

    09 The “typing effect” in a chat window is…

    10 You get HTTP 429 back. What is the provider saying?

    answered 0 / 10 · correct 0