How the LLM API cost calculator works
API cost is tokens multiplied by a per-million-token price, added up separately for the input you send and the output you receive. For each model the calculator takes your input tokens, multiplies by that model’s input price, adds your output tokens multiplied by its output price, and scales the result by calls per day and 30 days.
You can enter token counts directly when you are budgeting a feature that does not exist yet, or paste a sample prompt and let the calculator measure it with a real tokenizer. Sorting by cost per call makes the cheapest option obvious, and a warning marks any model whose context window is too small for your input.
Where the money actually goes
For chat-style features the reply is often the larger cost, because output tokens are priced at several times the input rate. For retrieval and document workloads the opposite is true: thousands of context tokens go in and only a short answer comes out. Look at both columns rather than only the total.
Repeated prompt prefixes — a long system prompt, a tool list, a reference document — are the biggest saving available. Providers price cache reads far below normal input, so the cached option can change which model is cheapest. Batch APIs, which most providers discount by around half for non-urgent work, are not modelled here.
Estimating before you build
- Start from a real example prompt and measure it rather than guessing.
- Estimate output length from the answers you want, then add a margin: replies vary.
- Multiply by realistic traffic, including retries and multi-turn conversations, which resend earlier messages.
- Re-run the numbers when a provider changes prices — the date shown is when they were last verified.
How to use it
- Enter the input tokens per call, or paste a prompt to measure it.
- Enter the expected output tokens per call and your calls per day.
- Read the per-month column, and tick the cache option if your prompt prefix repeats.
- Copy the comparison as a markdown table to share it.
Frequently asked questions
How current are the prices?
Prices were last verified on September 24, 2026 against the providers’ own pricing pages, and the date is shown next to every table. They can change without notice, so confirm a price on the provider’s page before signing a contract or setting a budget.
What does the cached-input option do?
Providers charge a much lower price for prompt text that they can serve from a cache, typically when the same long prefix is sent repeatedly. Ticking the option prices the input at each model’s cache-read rate where one is listed. Cache write charges and cache expiry are not modelled.
Does this include batch discounts or long-context surcharges?
No. It uses standard-tier list prices for prompts up to 200k tokens. Batch processing, long-prompt tiers, regional or data-residency multipliers and premium speed modes are billed differently by each provider and are not modelled.
How do I estimate output tokens?
Run a few typical requests, note the output length in the response usage, and use the average plus a margin. A useful reply of one paragraph is roughly 100–200 tokens; a page of text is closer to 700.
Prices verified September 24, 2026. Estimates only — your invoice depends on real token counts and the provider’s current pricing.