Skip to content
mentoor

Cost control

For engineers

Measuring token spend per request and feature, then cutting it with caching, batching, output caps and smaller models

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

A response reports 2,000 input tokens and 300 output tokens. Input costs $2 per million and output $10 per million. What does the call cost?

Choose one answer

Check yourself · 2 of 5

Why does a prompt that starts with the current timestamp get no cache hits?

Choose one answer

Check yourself · 3 of 5

Which task suits a batch API best?

Choose one answer

Check yourself · 4 of 5

How should you decide whether a cheaper model is good enough for a task?

Choose one answer

Check yourself · 5 of 5

Why does a 30-turn chat cost far more per turn at the end than at the start?

Choose one answer

Topics

  1. Counting tokens and cost per request4 min read · Input, output, cached and reasoning tokens, per-million prices, token counting before sending and cost per feature
  2. Cutting repeat input cost with prompt caching5 min read · Stable prefixes first, cache breakpoints, cache lifetime, write versus read pricing and measuring the hit rate
  3. Moving non-urgent calls to discounted batch pricing4 min read · Spotting calls that can wait hours and estimating what the batch discount saves on them
  4. Routing easy requests to smaller models4 min read · Matching each task to the cheapest model that passes its evaluation, and measuring the quality cost
  5. Capping output length and growing history5 min read · Output token limits, verbose answers, effort settings and conversation or agent history that grows every turn

Start here

Helps to know first

110 questions · last verified 2026-12