A narrated, hands-on workshop · ~60 min · for builders who want to know what they pay for

The API, Demystified.

Every AI feature you've ever shipped or paid for boils down to one HTTP call. Press play and I'll take that call apart with you — the request, the roles, the tokens, the tiers, the meter, the failures, and the key you must never leak. Read along below, or just listen.

13 chapters · player controls live at the bottom
POST https://api.anthropic.com/v1/messages  ·  headers: x-api-key (never in a browser — the workshop covers where it lives) · anthropic-version · content-type: application/json

Your request — four controls

The JSON that leaves your machine rendered live — nothing is sent

This whole page is offline. Every demo is simulated in your browser — no network calls, no key needed. The JSON above is the real wire format; edit any control and watch it re-render.

Ch. 1 / The mental model ▶ narrated

It's not a brain in your app. It's a phone call.

Strip away every SDK, framework, and buzzword, and "using AI" is one HTTPS POST: text goes out in a JSON envelope, text comes back in a JSON envelope, and the meter runs on both directions.

💻

Your code

Builds a JSON body

📮

HTTPS POST

One request, one URL

🧠

The model

Reads it, writes a reply

📦

JSON back

Reply + an exact receipt

📞

Stateless

The server forgets you the instant it answers. No session, no memory, no "it knows me." Whatever it should know rides inside each call.

// this changes everything
🧾

Metered

You rent computation per call, priced by how much text goes in and how much comes out. Every response includes the exact counts you were billed for.

// the receipt is built in
🪟

No magic

The chat website you already use is a pretty front-end doing exactly the call at the top of this page. Once you can read that call, nothing about AI apps is opaque.

// same wire, nicer paint

Ch. 2 / Anatomy of a request ▶ narrated

Four fields do almost all the work.

As I narrate this chapter, keep the builder at the top of the page in view. Change each control and watch which line of the JSON moves — that mapping is the lesson.

🏷️

model

An exact string id naming which model answers. Not a vibe — a spelling. Get it wrong and the API refuses the call. Different ids cost wildly different amounts (chapter 6).

// which brain
💬

messages

An array of turns, each with a role and content. This is the entire world the model sees — if a fact isn't in here (or in system), the model does not know it.

// the whole world
🛑

max_tokens

A hard ceiling on the reply's length. It's a stop valve, not a target — the model can finish early, but it can never write past this line. Your cost seatbelt.

// the ceiling
📜

system

Standing instructions that outrank the conversation: who the model is, its rules, its format. Kept separate from user text so instructions don't mix with data.

// the job description
Do this now: scroll up, switch the model, drag max_tokens, and rewrite the system line. Watch exactly one part of the JSON change each time. Provider dialects differ in small ways, but these four organs exist everywhere.

Ch. 3 / The memory illusion ▶ narrated

The model never remembers. YOU resend everything.

A "conversation" with an AI is a magic trick, and you're the magician: every single call, your code sends the entire history again. Click through a three-turn chat and watch the payload grow.

The conversation (what a user sees)

The payload YOUR code sends each call simulated — scripted replies, no network

// press "Send next message" —>
Watch the second send. The user says "give me three more like that" — four words that only mean something because turn one is riding along inside the payload. Delete the history and the model has no idea what "that" is. Memory isn't a feature of the API. It's a responsibility of your code — and a line item on your bill.

Ch. 4–12 / Locked

That's the free preview.

You've heard the setup. The remaining 9 chapters are where The API, Demystified actually gets built — the guardrails, the hands-on builds, the full narrated walkthrough and the end-of-workshop check.

Get the full workshop → See the catalog

One file. Yours forever. Works offline, in any browser, on any device.

Transcript

Now playing
Ready — press play to begin
0.95×
🎙
Free preview