Developer · AI

LLM API Cost Calculator

This LLM API cost calculator estimates what a feature will cost per call and per month on 26 Anthropic, OpenAI and Google models. Enter your tokens per call and calls per day, or paste a real prompt to measure it.

— tokens0 characters0 words
ModelInput tokensInput costOutput costPer callPer monthContext
GPT-5 nanoOpenAIcheapest≈2,000$0.0001$0.0002$0.0003$9.00400k
Gemini 2.5 Flash-LiteGoogle≈2,000$0.0002$0.0002$0.0004$12.001M
GPT-6 LunaOpenAI≈2,000$0.0002$0.00025$0.00045$13.50—
GPT-4o miniOpenAI2,000$0.0003$0.0003$0.0006$18.00128k
GPT-5.6 LunaOpenAI≈2,000$0.0004$0.0006$0.001$30.00—
GPT-5 miniOpenAI≈2,000$0.0005$0.001$0.0015$45.00400k
Gemini 3.5 Flash-LiteGoogle≈2,000$0.0006$0.00125$0.00185$55.501M
Gemini 2.5 FlashGoogle≈2,000$0.0006$0.00125$0.00185$55.501M
Gemini 3.8 FlashGoogle≈2,000$0.0015$0.001875$0.003375$1011M
GPT-5.4 miniOpenAI≈2,000$0.0015$0.00225$0.00375$113—
Claude Haiku 4.5Anthropic≈2,000$0.002$0.0025$0.0045$135200k
Gemini 3.5 FlashGoogle≈2,000$0.003$0.0045$0.0075$2251M
Gemini 2.5 ProGoogle≈2,000$0.0025$0.005$0.0075$2251M
GPT-4.1OpenAI2,000$0.004$0.004$0.008$2401.05M
Claude Sonnet 5Anthropic≈2,000$0.004$0.005$0.009$2701M
GPT-6 SolOpenAI≈2,000$0.004$0.005$0.009$270—
GPT-5.6 TerraOpenAI≈2,000$0.004$0.006$0.01$300—
GPT-4oOpenAI2,000$0.005$0.005$0.01$300128k
Gemini 3.1 Pro PreviewGoogle≈2,000$0.004$0.006$0.01$300200k
Claude Sonnet 4.6Anthropic≈2,000$0.006$0.0075$0.0135$4051M
Claude Opus 5.5Anthropic≈2,000$0.008$0.01$0.018$5401M
GPT-5.6 SolOpenAI≈2,000$0.008$0.01$0.018$540—
Claude Opus 5Anthropic≈2,000$0.01$0.0125$0.0225$6751M
GPT-5.5OpenAI≈2,000$0.01$0.015$0.025$750—
Claude Fable 5.1Anthropic≈2,000$0.02$0.025$0.045$1,3501M
GPT-6 AstraOpenAI≈2,000$0.02$0.025$0.045$1,350—

≈ marks a count estimated with OpenAI’s o200k_base encoding, because that model’s own tokenizer cannot run in a browser — the real figure can differ, and Anthropic notes its newer models produce roughly 30% more tokens than earlier ones. Exact counts are shown without ≈. Prices verified 2026-09-24.

Your text is tokenized in this browser and never uploaded.

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

  1. Enter the input tokens per call, or paste a prompt to measure it.
  2. Enter the expected output tokens per call and your calls per day.
  3. Read the per-month column, and tick the cache option if your prompt prefix repeats.
  4. 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.