DevTools Logo

Token Cost Calculator

Token Cost Calculator

Compare current LLM prices across providers with cache, batch, traffic and overhead — tokenized in your browser; only the public model catalog is refreshed.

Scenario

Token usage, traffic and the models to compare

0 chars0 wordsno text
Cache, reasoning, batch & overhead
Platform overhead0%
Context
DeepSeek
Xiaomi
Tencent
Z.ai
NVIDIA
MiniMax
StepFun
OpenAI
MoonshotAI
Anthropic
Google
xAI
Qwen
Custom models (stored on this device only)

    Examples

    Estimate 10,000 high-output requests

    Input
    Input tokens/request: 1,000
    Output tokens/request: 500
    Requests: 10,000
    Input price: $5 / 1M
    Output price: $25 / 1M
    Output
    Input / request: $0.005000
    Output / request: $0.0125
    Per request: $0.0175
    Total: $175.00

    Output tokens contribute most of the spend because their per-million rate is five times the input rate.

    Price one million tokens in each direction

    Input
    Input tokens/request: 1,000,000
    Output tokens/request: 1,000,000
    Requests: 1
    Input price: $3 / 1M
    Output price: $15 / 1M
    Output
    Input / request: $3.00
    Output / request: $15.00
    Per request: $18.00
    Total: $18.00

    At exactly one million tokens, each side's cost equals its quoted per-million rate.

    Use custom rates for a small workload

    Input
    Input tokens/request: 2,500
    Output tokens/request: 750
    Requests: 100
    Input price: $1 / 1M
    Output price: $2 / 1M
    Output
    Input / request: $0.002500
    Output / request: $0.001500
    Per request: $0.004000
    Total: $0.4000

    Sub-cent amounts retain extra decimal precision instead of rounding each request to a cent.

    About this tool

    Token Cost Calculator estimates LLM API spend for a token workload, then compares up to 10 models side by side. It breaks each request into regular input, cached read and write tokens, output, reasoning tokens and any per-request fee, applies a platform-overhead percentage, and rolls the result up per request and across a traffic plan.

    Prices ship in a versioned, source-linked fallback catalog that opens instantly with no network call. An optional Refresh pulls fresh metadata from the OpenRouter public models API, and you can add your own custom models with input, output, cache and batch rates, stored only on your device.

    You can paste a prompt to count its tokens with a real BPE tokenizer (exact for OpenAI o200k models, approximate for others) and feed the count straight into the calculation. Everything runs locally in your browser; the only outbound request is the optional catalog refresh, and the share URL carries only model ids and numeric assumptions. Results are estimates — confirm rates with the provider before budgeting.

    How to use

    1. Pick the models

      Select up to 10 models to compare and choose a reference model for the savings column. Add a custom model with your own rates if a provider isn't listed.

    2. Enter per-request usage

      Set input, output, cache-read/write and reasoning token counts for one representative request — or paste a prompt to count its input tokens automatically.

    3. Choose a mode

      Direct tokens multiplies one request's cost by a request count; the traffic simulator projects daily, monthly and yearly totals from requests/day, a monthly total, or active users × requests/user.

    4. Add modifiers and review

      Toggle batch pricing where supported, set a platform-overhead percentage, then read the per-component breakdown, comparison table and chart. Export to CSV/JSON/Markdown or copy a share URL.

    Use cases

    Forecast a production feature

    Combine observed input/output usage with projected request volume to estimate a monthly LLM budget.

    Compare model economics

    Keep token counts and request volume constant while switching rates to see how model choice changes spend.

    Evaluate prompt trimming

    Reduce the input-token field by the amount removed from a prompt and quantify the savings at scale.

    Reconcile an API usage sample

    Enter token counts from a provider response and custom current rates to reproduce the expected line-item cost.

    Common mistakes

    Mistake:Treating cached tokens as regular input.

    Fix:Put prompt-cache read and write tokens in their own fields — they're billed at the cheaper cache rate, and only the remainder counts as regular input.

    Mistake:Assuming identical token counts mean identical quality across models.

    Fix:The comparison holds the token workload constant for a fair price comparison; it does not imply two models produce the same output or need the same number of tokens.

    Mistake:Using the bundled reference price as a permanent quote.

    Fix:Pricing changes and special tiers may apply. Check the provider and use Custom prices for the rate attached to your account and workload.

    Mistake:Entering the total tokens for all requests in a per-request field and also setting request count.

    Fix:Enter usage for one request, then set volume; otherwise the calculator multiplies the workload twice.

    Mistake:Ignoring the difference between input and output rates.

    Fix:Keep the token counts separate. Many models price generated output substantially higher than prompt input.

    Frequently asked questions

    References & standards