AI API cost calculator

Put in your real token volume. See what the official list price would be, what the gateway route costs, and what the gap is worth over a year.

—

Want that number to be real? Create an account, add credit, and change your base URL. Get API access →

How to estimate your tokens

If you do not have exact numbers, these are realistic starting points:

WorkloadInput / monthOutput / month
Solo dev using a coding agent daily150M – 400M10M – 30M
Small team (3–5 devs)600M – 1.5B40M – 100M
Chatbot, ~50k conversations80M – 200M15M – 40M
RAG pipeline, 100k documents300M – 800M30M – 80M

Measure your own split instead of guessing it

Every model in this index prices output at a multiple of input, and that multiple runs from 3× to 8.3× depending on which model you pick. Guessing the ratio is the largest single source of error in a cost estimate And it is measurable in about ten lines. Log the usage object on every call:

import json

# 把每次调用的 usage 落盘,一周后你就有了自己的 in:out 比例。
# 拿这个比例去 /calculator/ 比价,比对着价目表猜准得多 ——
# output 单价是 input 的好几倍,猜错方向就是往贵了算。
with open("usage.jsonl", "a") as fh:
    fh.write(json.dumps({
        "model": model,
        "in": resp.usage.prompt_tokens,
        "out": resp.usage.completion_tokens,
    }) + "\n")

A week of that gives you a real in:out ratio, which is the only input the calculator actually needs from you. Rates follow vendor promotions and can move without notice, so a per-call record is also the only thing that tells you later whether a price change actually hit you, and in which direction.

What the calculator does not include

Calculators for specific tools

A generic token estimate hides what each tool actually does with context. These two have their own pages, with starting values that match how they behave:

Figures are estimates based on list prices verified 2026-10-31. Actual spend depends on your cache hit rate, batch usage and long-context tiering.