🧾 Machines That Talk · Day 2

The Token Price Tag

Yesterday you counted tokens. Today you learn the secret every AI company knows and most users don't: you pay per token — and the AI's answer usually costs more than your question. Let's print your first AI receipt.

↓ ring it up
🧾 Lab · The AI Receipt

Every message has two price tags

Type what you'd ask the AI (that's your input). Then drag how long the AI's reply should be. The receipt updates live. Notice the two different prices!

220

how many tokens the AI writes back (the answer)

💵 Model price (per 1,000,000 tokens) — try changing it!

$3
$15

Real models charge more for OUT than IN — writing is harder work than reading.

input
output

the split of your bill: 🟦 what you sent vs 🟪 what the AI wrote back

🐞 Break-It Challenge

The 3-word question that costs a fortune

Some of the cheapest-looking prompts are the most expensive. Tap these and watch the receipt — a tiny input can trigger a giant, pricey output.

See it? "Write a 2000-word story" is only a few input tokens, but it makes the AI generate a huge, expensive output. You're billed for what the AI writes, not just what you type. That's why asking for "everything" is a money trap.
🏷️ The pro wordThe tokens you send are input tokens (also called prompt tokens); the tokens the AI writes back are output tokens (or completion tokens). Prices are quoted per million tokens. The formula never changes: cost = tokens × price ÷ 1,000,000, added up for input and output separately.
🎯 Boss Build · Hit the Budget

Become the cost controller

You're given a target price. Using the current prompt and model prices, drag the answer length so the total lands within the target. Nail 3 targets to win the badge!

🎯 Target: —
300

answer length (output tokens)

Hit: 0 / 3
🚀 Beyond the Basics

How the pros really do it

Your receipt is exactly how real AI billing works. Here's how people estimate cost, from rough to exact:

📏

Count characters (rough guess)

~4 characters ≈ 1 token in English. ✅ Instant mental math. ⚠️ Way off for code, numbers, and other languages.

🔢

Count real tokens (what you did)

Run the actual tokenizer, split input vs output. ✅ Accurate. ✅ Matches your bill. ⚠️ You must know each model's prices.

🧾

Read the usage meter (the real deal)

Every API reply reports exact input & output tokens used. ✅ Perfectly exact. ✅ Tracks caching & discounts. ⚠️ Only known after the call.

🏷️ Pro names to look upReal replies include a usage object with prompt_tokens and completion_tokens. Cheaper models also offer prompt caching (repeated input costs less) and batch pricing (slower = cheaper).

🎉 Day 2 Complete!

You can now read an AI receipt: input tokens + output tokens, each at its own price, added with tokens × price ÷ 1,000,000. And you learned the big trap — the AI's answer usually costs more than your question.

Day 3: Guess the Next Word →
Tomorrow: we open up the AI's brain and watch it do the one thing it actually does — guess the next word. 🔮
AI Adventure · Machines That Talk · Day 2 — made for young inventors 🚀