C.W.K.
Stream
Lesson 08 of 10 · published

Pricing and Rate Limits — Real Numbers

~12 min · providers, pricing

Level 0Apprentice
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

The numbers move; the structure is stable

Pricing changes; rate limits change; the categories don't. Each provider has: input tokens, output tokens, cached input tokens, image tokens, audio tokens, and reasoning tokens with their own bills. Rate limits exist as RPM (requests per minute), TPM (tokens per minute), and per-model concurrency caps.

Cost intuition (check live numbers before quoting)

  • Top-tier (Opus / GPT-5.5 / Gemini 2.5 Pro) is roughly 5–15× cheaper on input than on output, and reasoning tokens are billed separately.
  • Mid-tier (Sonnet / GPT-5.5-mini / Gemini Flash) is typically 3–10× cheaper than top-tier for similar throughput.
  • Cached input is 5–25% of normal input.
  • Open-source per-call is amortized compute; the bill comes from utilization, not per-token rate.

Rate limit traps

  • Burst patterns hit RPM limits before you exhaust TPM. Smooth your traffic.
  • Long-context calls eat your TPM budget faster than throughput suggests.
  • Some providers gate top-tier models behind tier-up requirements.

Code

Cost monitor (sketch)·python
from collections import defaultdict

buckets = defaultdict(int)
for resp in stream_recent_responses():
    buckets[(resp.provider, resp.model, "input")] += resp.usage.input_tokens
    buckets[(resp.provider, resp.model, "output")] += resp.usage.output_tokens
    if resp.usage.cache_read_input_tokens:
        buckets[(resp.provider, resp.model, "cache_read")] += resp.usage.cache_read_input_tokens
    if resp.usage.thinking_tokens:
        buckets[(resp.provider, resp.model, "thinking")] += resp.usage.thinking_tokens

External links

Exercise

Pull the last week's traffic for one prompt. Break out tokens by category (input, output, cached, thinking). Identify the largest bucket and one experiment to reduce it.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.