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
Cache, reasoning, batch & overhead
Custom models (stored on this device only)
Examples
Estimate 10,000 high-output requests
Input tokens/request: 1,000
Output tokens/request: 500
Requests: 10,000
Input price: $5 / 1M
Output price: $25 / 1MInput / request: $0.005000
Output / request: $0.0125
Per request: $0.0175
Total: $175.00Output 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 tokens/request: 1,000,000
Output tokens/request: 1,000,000
Requests: 1
Input price: $3 / 1M
Output price: $15 / 1MInput / request: $3.00
Output / request: $15.00
Per request: $18.00
Total: $18.00At exactly one million tokens, each side's cost equals its quoted per-million rate.
Use custom rates for a small workload
Input tokens/request: 2,500
Output tokens/request: 750
Requests: 100
Input price: $1 / 1M
Output price: $2 / 1MInput / request: $0.002500
Output / request: $0.001500
Per request: $0.004000
Total: $0.4000Sub-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
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.
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.
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.
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
Related guides
Understanding LLM API Token Costs (and How to Estimate Your Bill)
How LLM APIs bill per token, why input and output rates differ, what actually drives your bill, and how to estimate costs before you ship.
Comparing LLM API Prices: How to Think About OpenAI vs Anthropic vs Google
Why a per-token price tag doesn't tell the whole story, how to compare models on your actual workload, and how to run an apples-to-apples cost estimate.
References & standards
Related tools
AI Code Explainer
Explain code snippets with grounded cloud AI
AI Commit Message Generator
Suggest Conventional Commits messages from a git diff using on-device WebLLM
AI Documentation Generator
Generate validated JSDoc/TSDoc blocks with cloud AI
AI Regex Generator
Turn natural language into a regex pattern with cloud AI
AI SQL Query Generator
Generate SQL from natural language with cloud AI and sql-formatter output
Context Assembler
Combine files and folders into one LLM-ready context block with XML tags, a project tree, ignore filters and a token estimate — like repomix or files-to-prompt, in your browser.