AI for Beginners · Lesson 9

One model, many doors

For most people, "AI" means a chat window — ChatGPT, Claude. That window is a product, not the model itself. This lesson shows the other door into the exact same model, and how parameters and tokens — the words you already have — combine into a price you can go and look at today.

CourseAI for Beginners
Lesson9 of 14
Builds onHow to talk to it
The chat box is a product

You've been looking at the wrapper

ChatGPT.com and Claude.ai are polished, friendly front doors — a conversation window, a send button, a company's own design — built by OpenAI and Anthropic around their models. That's a real, deliberate product. It is not the only way in, and for most of what actually gets built with this technology, it isn't even the usual way in.

The other door

The API — no chat window required

There's a second door into the same model, meant for software rather than a person typing in a browser. It's called an API — the letters stand for Application Programming Interface, though almost nobody says the long version out loud.

An API is simply a door a piece of software can knock on: send some text in, get the model's prediction back out, with no chat window anywhere in between. Any business — one far smaller than OpenAI — can build its own product on top of that same door: its own interface, its own prompts and context from Lesson 8, wrapped around someone else's model.

Two doors into the same model A chat interface like ChatGPT or Claude on the left, and a business's own product using the API directly on the right, both send text down into the same central model and receive the same kind of answer back. CHATGPT.COM · CLAUDE.AI the chat interface { } A BUSINESS'S OWN PRODUCT the API — direct THE SAME MODEL, EITHER WAY
A person typing into a chat window, or a business's own software calling the API — both are just a door. What's behind either door is the same model, the same floor, the same kind of answer.

Underneath the JSON and the pricing ahead, "the model" is still the coin-and-pegs machine from Lesson 1 — just enormous, and reached through a door instead of a hand. See the real device this course is modeled on.

What actually gets sent

A real request, decoded

Every provider phrases this a little differently, but the shape underneath is always close to this. Not a working example — no key here would get you a real answer — but the real shape of what a piece of software actually sends through that door.

curl https://api.example.com/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "model-large-2026",
    "max_tokens": 60,
    "messages": [
      {"role": "user", "content": "In two sentences, why do Labradors make good family pets?"}
    ]
  }'

Look familiar? messages is Lesson 8's backpack, spelled out literally — "role": "user" is the dashed, just-added piece. Anything carried over from earlier in the conversation would sit right above it in that same array, unchanged, exactly like the boxed history in that diagram.

What comes back is just as recognizable:

{
  "model": "model-large-2026",
  "content": [
    {"type": "text", "text": "Labradors are famously gentle and patient, which makes them steady around children and easy to train. Their friendly, people-focused temperament is exactly what most families are hoping to find in a dog."}
  ],
  "usage": {
    "input_tokens": 18,
    "output_tokens": 42
  }
}

Two numbers at the bottom, and you already know exactly what they mean: input_tokens and output_tokens — the same two words the pricing strip ahead uses, reporting precisely what got charged for this one call. Nothing about a real API call was ever a mystery beyond this.

Sometimes the model needs help

Tool use

Remember Lesson 7's list of things a model genuinely can't do on its own — live facts, exact counting? This is how the wrapper covers for it, without changing what the model actually is.

A model can be trained to recognize one more shape of reply besides prose: a request. Instead of writing an answer, it writes something like "call this, with these inputs" — and the app watches every reply for exactly that shape. Watch the same messages array from a moment ago carry the whole exchange.

You ask something the model can't just know:

{"messages": [
  {"role": "user", "content": "What's the weather in Provo, Utah right now?"}
]}

The model doesn't answer in prose. It asks for help:

{"content": [
  {"type": "tool_use", "name": "get_weather", "input": {"location": "Provo, UT"}}
]}

The app actually calls a weather service — somewhere outside the model entirely — then pours the whole backpack through again: the original question, the model's request, and the real answer, all now sitting in the array together.

{"messages": [
  {"role": "user", "content": "What's the weather in Provo, Utah right now?"},
  {"role": "assistant", "content": [{"type": "tool_use", "name": "get_weather", "input": {"location": "Provo, UT"}}]},
  {"role": "tool", "content": "72°F, clear skies"}
]}

Only now does the model write something you actually see: "It's a clear 72°F in Provo right now."

Notice what didn't happen: the model never reached outside itself. It can't — all it has ever done, since Lesson 1, is predict the next tokens. Something outside the model made the real call, then poured the answer back in as one more piece of the backpack. The model just did what it always does: read everything in front of it, and leaned toward the likeliest next word. This time, the likeliest next word happened to be true, because the app made sure it was sitting right there in the context.

This is also the trick Lesson 7 promised. The weather lookup itself is deterministic — ask ten times, get 72°F back every time, because it's a real call to a real service, not a stray pick from a pile. The model's own phrasing of it can still vary a little; the fact it's phrasing now can't.

What it costs to walk through

Priced by the million, sized by the model

Walking through the API door isn't free the way the chat window often feels free. It's priced per token — almost always quoted per million tokens, because a single token costs a tiny fraction of a cent and nobody wants to read that many decimal places.

Two patterns are worth knowing, and both follow straight from what you already have. Bigger models — more parameters — cost more per token, because every prediction takes more computing to make. And output almost always costs more than input: reading your whole prompt happens in one pass, but Lesson 3's loop means writing the reply back out takes one full pass through the model per token, one at a time.

Model size Example price — input Example price — output
~3 billiona few cents / milliona bit more
~30 billiontens of cents / milliona few times more
~1 trillion +a few dollars / millionseveral times more

Illustrative shape, not live pricing — real rates vary by provider and change often. The pattern is what matters: bigger model, pricier token; output pricier than input.

Multiply this across many agents and many calls, and the bill becomes a real design problem — worth engineering against, not just budgeting for. How orqo engineers it down.

A place you can actually see it

Where the words on this page turn into a real menu

Sites like OpenRouter list dozens of models side by side — a menu a developer or a business picks from. Every row names a model, its size where it's published, and its price per million input and output tokens, exactly the shape of the table above, with real numbers instead of illustrative ones.

The first time this page makes sense to you, the fog around "AI pricing" mostly clears. It was never a mystery — it's a menu, priced the way we just described, and you now have every word on it.

Reading the real thing

What that string of numbers actually says

Open a listing on a site like OpenRouter and you'll see a short line like this, for almost every model:

Context1M tokens
Input$1.60 / M tokens
Output$15.00 / M tokens
Cache$0.30 / M tokens

Three of those four words you already have. Context is the funnel size from Lesson 6 — this one holds up to a million tokens in view at once. Input and output are exactly the pricing pair from the table above — and notice output here really is nearly ten times pricier than input, the same pattern, now with real numbers behind it: one pass to read your prompt, one pass per token to write the reply.

The fourth word is new. Cache is the discount for not making the model repeat itself. Remember Lesson 3's loop: every single pass re-pours the entire growing line back through the funnel, from the very start — including everything that was already there a moment ago. If the model just walked through that same beginning on the last pass, a cache lets it remember that work instead of redoing it from scratch. You pay the small cache rate for the part it's just recalling, and the full input rate only for what's genuinely new. That's why $0.30 is so much smaller than $1.60 — it's the price of memory, not the price of reading something fresh.

This is how it's actually built

Nobody builds their own model

When a business builds something powered by AI — a report generator, an assistant, an agent — it is almost never building a new model from scratch. It's choosing a door, pouring in carefully designed prompts and context, and wrapping the answer in its own product. The exact same pattern OpenAI used for ChatGPT itself, just a different front door.

It's the same path this platform itself takes. orqo is model-agnostic: every agent you build here calls out through exactly this kind of door, using whichever provider and model you connect. orqo handles the prompts, the context, and the orchestration; the answer comes back through the same door, priced the same way, and gets woven into your workflow. The same door, the same table, put to work. See how those workflows actually get built.

Next

What actually happens to what you type

One door or the other, you're sending your words somewhere. The last lesson answers the question underneath all of this: what happens to it — so the last of the worry can go.

The whole picture, continued

The glossary, 5 rows longer

Everything from the lessons before this one, plus what this lesson added.

The board The word for it
The board and its pegsThe structure — the model
A single pegA neuron
A single step from one peg to the nextA connection
How red or blue a patch of floor isA weight — a parameter
The whole painted floorThe trained model
Boards stacked, one on the nextLayers — "deep"
Smearing the floor in, coin by coinTraining
Dropping one coin through a finished boardUsing it — inference
Which slot you pour intoYour input — your prompt
The bins, relabelled with tokensThe vocabulary — every token it could pick
The tallest pile among the binsThe prediction — the likeliest next token
Feeding the growing line back in and running againThe loop — how one guess becomes a sentence
One bin's label, preciselyA token — not always a whole word
How many bins there are, in totalVocabulary size — tens of thousands
The size of the mountain of text it was shownTraining data — measured in tokens
A bin's own address, plotted in spaceAn embedding — meaning turned into a list of numbers
How close two addresses sitSimilarity — how related two things are
The measurement's real name, out in the wildCosine similarity — same idea as similarity, different name
About meaning, not exact spellingSemantic
A neighbourhood of addresses that share a topicA domain — a cluster of related meaning
Scanning every address for whichever one sits closest to a new pointNearest neighbor — the closest real match to a computed point
A small, separate machine that only plots words as points — it never writes a sentenceAn embedding model — not the same as a language model
The total number of coloured patches, across every boardParameters — the number people quote
How many tokens the funnel can hold in one pourInput tokens — the context window
How many tokens come back outOutput tokens — what it writes back
Everything you've met so far, built at real-world sizeA Large Language Model — an LLM
A shorter pile winning, extended forward with full confidenceA hallucination
The point where the training reading stoppedThe knowledge cutoff
How sharp or blended the colour stays before a coin is pouredTemperature — the dial on how often a stray pick wins
Pouring the same slot twice, not always the same pileNon-deterministic — same input, no guaranteed identical output
Background, examples, or a role, added right into the pourContext
Asking for many small steps instead of one big leapChain-of-thought prompting
+ New in this lesson
A friendly chat window built around the boardA product — like ChatGPT or Claude.ai
A door that lets software pour in and read out directlyAn API
What each million tokens costs to send in or get backAPI pricing — pricier for bigger models, and for output
Recalling the start of the line instead of re-pouring itCached tokens — priced far cheaper than fresh input
The board asking the app to go do something real before it answersTool use — or function calling

37 rows now. It keeps growing as the course goes on.

Lesson 9 of 14

Sign in to orqo

Choose how you'd like to continue.

More ways to sign in are on the way.