Calculate API costs before scaling
A reproducible token-cost example and practical limits for real applications.
Reviewed 2026-11-08
Read the complete price rule
Check USD per million tokens, your group discount, cache rates, and time or context tiers. A missing cache rate does not mean free. Use the current rule for the concrete model that serves the request.
Reproduce the calculation
Teaching rates only: $1.00 per million input tokens and $4.00 per million output tokens. With 1,000 input and 250 output tokens, one request costs $0.002; 10,000 identical requests cost $20.00 before other charges or taxes. These are not live model prices.
(1,000 × $1.00 + 250 × $4.00) / 1,000,000 = $0.002
10,000 × $0.002 = $20.00Measure cache use instead of assuming savings
A repeated prompt does not guarantee a cache hit. Model, credential, context, timing and provider policy matter. Separate cache token categories and use the actual billing rule to avoid counting input twice.
Turn a forecast into operating controls
Start with a small key quota, expiry and restricted models. Monitor budgets and compare forecast with actual usage before raising limits. Test quality before switching to a cheaper model; no unsupported savings or quality percentage is promised.