Ch 3 — Hidden Multipliers

Reasoning tokens, quadratic scaling & surcharges — the iceberg analogy
High Level
ac_unit
Iceberg
arrow_forward
psychology
Thinking
arrow_forward
expand
Scaling
arrow_forward
add_shopping_cart
Surcharges
arrow_forward
discount
Discounts
arrow_forward
functions
Formula
-
Click play or press Space to begin...
Step- / 8
ac_unit
The Iceberg Analogy
The visible response is the tip; the real cost is underwater
What You See
When you use a reasoning model like OpenAI’s o3 or DeepSeek R1, you see a clean, concise response — maybe 500 tokens. That’s the tip of the iceberg. It looks manageable. You multiply 500 tokens by the output price and think, “That’s cheap.”
What You Don’t See
Beneath the surface, the model generated thousands of invisible “thinking tokens” before producing your visible response. These tokens represent the model’s internal chain-of-thought reasoning — exploring solution paths, verifying logic, self-correcting. They’re billed at full output token rates but you never see them. A 500-token visible response can actually cost the same as a 10,000-token response.
Key insight: Reasoning models are 5–14x more expensive per request than standard models, not because the visible output is longer, but because the invisible thinking process generates enormous token volumes beneath the surface.
psychology
Reasoning Tokens by Complexity
Simple questions vs hard problems — the thinking tax
Thinking Token Volume
// Invisible thinking tokens by task complexity Simple question 200–500 thinking tokens Moderate reasoning 2,000–5,000 thinking tokens Complex problem 5,000–20,000 thinking tokens Extremely hard 20,000–50,000+ thinking tokens // Real cost example (o3 at $2/$8 per M) Visible response: 500 tokens = $0.004 Thinking tokens: 9,500 tokens = $0.076 Total output cost: 10,000 tokens = $0.080 // You thought you paid for 500 tokens // You actually paid for 10,000
The Unpredictability Problem
Unlike standard models where output length is somewhat predictable, thinking token volume is entirely unpredictable. The same question asked slightly differently can trigger 500 or 15,000 thinking tokens. This makes cost forecasting for reasoning models extremely difficult. You can’t budget for what you can’t predict.
Key insight: The 400x price gap between reasoning models is real: DeepSeek R1 at $0.42/M output vs o3-pro at $80/M output. For a task generating 20,000 thinking tokens, that’s $0.008 vs $1.60 — a 200x difference for the same reasoning quality tier.
expand
Quadratic Attention Scaling
The shipping weight analogy — double the package, quadruple the cost
The Shipping Weight Analogy
Imagine shipping costs worked like this: a 1 kg package costs $1, but a 2 kg package costs $4 (not $2). A 4 kg package costs $16. That’s quadratic scaling — doubling the weight quadruples the cost. This is exactly how transformer attention works. Every token must compare itself with every other token in the context, creating O(n²) complexity.
// Attention comparisons by context length 1K tokens 1 million comparisons/layer 4K tokens 16 million comparisons/layer 32K tokens 1 billion comparisons/layer 128K tokens 16 billion comparisons/layer 1M tokens1,000 billion comparisons/layer
Why This Matters for Your Bill
Quadratic scaling means the cost per token increases as context grows. The 128,001st token is more expensive to process than the 1st token, because it must attend to all 128,000 tokens before it. This is why providers charge surcharges for long contexts — the infrastructure cost genuinely increases non-linearly.
Key insight: This is the fundamental reason why “just throw everything into the context window” is an expensive strategy. A 128K context doesn’t cost 128x more than a 1K context — it costs orders of magnitude more in compute. Context compression (Chapter 6) exists to fight this curve.
add_shopping_cart
Context Window Surcharges
The 2x price jump above 200K tokens
Provider Surcharges (March 2026)
Both Anthropic and Google apply explicit price surcharges for long contexts. When your request exceeds 200K tokens, the per-token price doubles. This isn’t hidden — it’s documented on their pricing pages — but many developers miss it when estimating costs.
// Context surcharge examples Claude Opus 4.6 <200K tokens: $5.00/M input >200K tokens: $10.00/M input (2x) Gemini 2.5 Pro <200K tokens: $1.25/M input >200K tokens: $2.50/M input (2x) GPT-5 400K context, no surcharge
The Practical Impact
A RAG system that retrieves 50 documents averaging 5,000 tokens each loads 250K tokens per request. On Claude Opus, the first 200K costs $1.00 and the remaining 50K costs $0.50 (at the 2x rate). The surcharge adds 50% to the total input cost for that last 50K tokens. Keeping context under 200K becomes a concrete cost optimization target.
Key insight: Context surcharges create a pricing cliff. Staying just under 200K tokens can save you 2x on the marginal cost. This is why context compression and selective retrieval aren’t just nice-to-haves — they have direct, measurable cost impact.
discount
Discounts That Reduce the Bill
Cached tokens, batch APIs, and volume pricing
Prompt Caching
When you send the same prefix (system prompt, tool definitions, few-shot examples) across multiple requests, providers can cache the processed tokens and reuse them. Anthropic offers ~90% discount on cached token reads. OpenAI offers ~50% discount for prompts over 1,024 tokens. This is the single highest-ROI optimization — 10 minutes to implement, 45–90% savings on repeated prefixes.
Batch API
For workloads that don’t need real-time responses, batch APIs process requests asynchronously at 50% off the standard price. Ideal for data processing, evaluation, content generation, and any task where a few hours of latency is acceptable.
Discount Impact
// Discount stacking example Base cost: $10,000/month Prompt caching: -$4,500 (45% of input) Batch API: -$1,500 (50% off async) After discounts: $4,000/month // 60% reduction with zero quality impact
Key insight: Discounts are the “good” hidden multipliers. Most teams leave 40–60% savings on the table simply because they don’t enable prompt caching or use batch APIs for eligible workloads. These are covered in depth in Chapter 6.
functions
The Full Cost Formula
Everything that goes into your actual bill
The Complete Equation
// Your actual cost per request actual_cost = (input_tokens × input_price) + (output_tokens × output_price) + (thinking_tokens × output_price) + (surcharge on tokens > 200K) - (cached_tokens × cache_discount) - (batch_discount if async) // The sticker price formula sticker_cost = (input_tokens × input_price) + (output_tokens × output_price) // actual_cost can be 2–20x higher // than sticker_cost for reasoning models
Why Sticker Price Is Misleading
Most cost estimates use the sticker price formula — input tokens times input price plus output tokens times output price. But the actual cost includes thinking tokens (which can be 10–20x the visible output), surcharges (2x above 200K), and misses discounts (caching, batching). Teams that budget on sticker price alone typically underestimate by 2–3x.
Key insight: Always ask three questions before estimating cost: (1) Does this model use reasoning/thinking tokens? (2) Will my context exceed 200K tokens? (3) Am I using caching and batch discounts? The answers can swing your estimate by 5–10x in either direction.
compare_arrows
The 400x Reasoning Model Gap
DeepSeek R1 vs o3-pro — same capability class, wildly different price
Reasoning Model Pricing (March 2026)
// Reasoning models: input / output per M tokens DeepSeek R1 V3.2 $0.28 / $0.42 o3 $2.00 / $8.00 o3-pro $20.00 / $80.00 o1-pro $150 / $600 // Same task (20K thinking + 500 visible output) DeepSeek R1: $0.009 o3: $0.164 (18x more) o3-pro: $1.640 (182x more) o1-pro: $12.30 (1,367x more)
When to Use Each Tier
DeepSeek R1 handles 80% of reasoning tasks at negligible cost. o3 is the sweet spot for hard coding and math problems. o3-pro is for competition-level problems where accuracy is paramount. o1-pro is rarely justified outside research labs. The quality difference between tiers is real but narrow for most practical tasks.
Key insight: The reasoning model you choose has a bigger cost impact than any other decision. Running 1,000 complex tasks/day on o1-pro costs $12,300/day ($369,000/month). The same tasks on DeepSeek R1 cost $9/day ($270/month). That’s a 1,367x difference.
lightbulb
The Iceberg, Mapped
All hidden multipliers in one view
Above the Waterline (Visible)
Input tokens — your prompt, context, documents. Visible output tokens — the response you see. These are what the sticker price covers. For standard models (GPT-4o, Claude Sonnet), this is the full picture. For reasoning models, it’s just the tip.
Below the Waterline (Hidden)
Thinking tokens — 5–100x the visible output, billed at output rates. Quadratic scaling — each additional token costs more than the last. Context surcharges — 2x price above 200K tokens. Conversation accumulation — history grows with every turn. Tool schema overhead — 500+ tokens per tool, every request.
What’s Next
Chapter 4 takes everything from Chapters 1–3 and applies it to real-world bills. Five worked examples with March 2026 pricing: a consumer chat app, a customer support bot, a code assistant, a RAG system, and an autonomous agent fleet. The electricity bill analogy — moving from per-token thinking to monthly bill thinking.
Key insight: The hidden multipliers work in both directions. Thinking tokens and surcharges inflate your bill 2–20x above sticker price. Caching and batch discounts reduce it 40–60%. The teams that understand both sides of the iceberg are the ones that build sustainable AI economics.