LLM API Cost Calculator

The LLM API cost calculator estimates monthly spend for ten current models from OpenAI, Anthropic, and Google. It multiplies average input and output tokens per request by monthly request volume, divides each total by one million, and applies each provider's published per-million-token rates: monthly cost equals input millions times the input rate plus output millions times the output rate. All prices are standard pay-as-you-go rates in US dollars, verified July 2026.

Monthly cost by model
Input tokens per month
Output tokens per month

Prices last verified July 24, 2026. Figures are estimates in US dollars; confirm with each provider before committing.

Enter your average input and output tokens per request and your monthly request volume, and the table compares what that traffic costs per month on ten current models from OpenAI, Anthropic, and Google. Each row splits the total into input cost and output cost, and the cheapest row is highlighted. The two figures below the table show your monthly token volume in millions, the unit every provider's price list is quoted in. The math runs entirely in your browser and nothing you type is sent anywhere.

How token pricing works

Every major LLM API bills the same way: one rate per million tokens the model reads, a separate and always higher rate per million tokens it generates. A token is the model's own unit of text, produced by a subword tokenizer, usually a byte-pair-encoding one, and comes out to roughly four characters of English, so a thousand tokens is about 750 words. The calculator converts your per-request averages into monthly volume and applies both rates for each model:

monthly = (tokensin × requests ÷ 1,000,000) × ratein + (tokensout × requests ÷ 1,000,000) × rateout

With the defaults, 1,200 input tokens and 400 output tokens across 100,000 requests, you accumulate 120 million input and 40 million output tokens a month. On Claude Opus 4.8 at $5 and $25 per million that is 120 × 5 + 40 × 25 = $1,600.00. The identical traffic on Gemini 3.1 Flash-Lite is 120 × 0.25 + 40 × 1.50 = $90.00. A nearly 18x spread for the same workload is why model choice is usually the largest single lever on an LLM product's unit economics, ahead of prompt trimming and well ahead of infrastructure.

Where per-token billing came from

The token was a unit of text long before it was a unit of price. Byte-pair encoding started as a data-compression method that Philip Gage described in 1994, and it returned to language work when Rico Sennrich, Barry Haddow, and Alexandra Birch adapted it for neural machine translation, in a paper published at ACL 2016, as a way to split rare words into reusable subword pieces. GPT-2 and GPT-3 used a byte-level version of that scheme, which is why the token became the natural thing to meter: the compute a request needs scales with how many tokens the model processes, not with wall-clock time or the number of calls.

OpenAI turned that unit into a bill in 2020. The GPT-3 API opened as a private beta in June 2020, was free during an initial trial period, and moved to paid plans on 1 October 2020, built as tiered monthly subscriptions with a token allowance rather than the pure meter that came later: 100,000 tokens free, $100 a month for two million, $400 a month for ten million, and a custom tier above that. Four base models were offered, named Ada, Babbage, Curie, and Davinci in ascending order of size, from 350 million parameters to 175 billion, with Davinci the most expensive. Earlier commercial text APIs had metered by the character, as Google Translate did, so charging by the token was a small but consequential shift toward billing in the model's own currency.

The rate structure this calculator inherits took shape in 2023. On 1 March 2023 OpenAI released gpt-3.5-turbo at $0.002 per thousand tokens, which it called ten times cheaper than its earlier GPT-3.5 models. Two weeks later, on 14 March 2023, two things landed the same day: OpenAI announced GPT-4 at $30 per million input tokens and $60 per million output, and Anthropic introduced Claude alongside the faster Claude Instant through its own API. GPT-4 is where the split every row of the table now uses became standard, an input rate and a distinctly higher output rate rather than one blended number. Google announced its PaLM API the same day, and that lineage runs forward into Gemini.

Prices have fallen steeply since. GPT-4 worked out to about $36 per million tokens at launch on a typical read-heavy mix; GPT-4o followed in May 2024 at $5 input and $15 output and was cut to $2.50 and $10 that August. The models in the table below are newer and the names have moved on, but the shape, two rates per model quoted per million tokens, is the one fixed in 2023.

Current API prices

The table below reads from the same data file the calculator uses, so the two cannot drift apart. Rates are standard pay-as-you-go prices in US dollars per million tokens, taken from OpenAI's, Anthropic's, and Google's published pricing pages and verified July 2026.

Model Provider Input per 1M Output per 1M
GPT-5.6 Sol OpenAI $5 $30
GPT-5.6 Terra OpenAI $2.5 $15
GPT-5.6 Luna OpenAI $1 $6
Claude Fable 5 Anthropic $10 $50
Claude Opus 4.8 Anthropic $5 $25
Claude Sonnet 5 Anthropic $3 $15
Claude Haiku 4.5 Anthropic $1 $5
Gemini 3.1 Pro Google $2 $12
Gemini 3.6 Flash Google $1.5 $7.5
Gemini 3.1 Flash-Lite Google $0.25 $1.5

Two notes on reading it. Anthropic's published rates give Claude Sonnet 5 a $3/$15 sticker, which is what the table and the calculator use; new API traffic is billed at an introductory $2/$10 through August 2026, so real Sonnet 5 invoices run about a third lower until then. And the spread within each provider is deliberate tiering: OpenAI's GPT-5.6 line spans 5x from Luna to Sol on output, Anthropic's spans 10x from Haiku to Fable, and Google's Flash-Lite exists specifically to win the high-volume, low-stakes tier.

How the bill scales

The same formula behaves very differently at three sizes. A hobby chatbot serving 5,000 requests a month at 800 input and 300 output tokens accumulates 4 million input and 1.5 million output tokens; on Gemini 3.1 Flash-Lite that is 4 × 0.25 + 1.5 × 1.50 = $3.25, and even Claude Opus 4.8 reaches only 4 × 5 + 1.5 × 25 = $57.50, so the sensible move is to pick the smartest model and ignore cost. A startup at the defaults, 100,000 requests at 1,200 and 400 tokens, pays $1,600.00 on Opus 4.8, 120 × 3 + 40 × 15 = $960.00 on Claude Sonnet 5, and $90.00 on Flash-Lite; this is the scale where routing the easy majority of requests to a cheap model starts to pay. A scale-up at 2 million requests with 2,000 input and 600 output tokens moves 4 billion input and 1.2 billion output tokens a month, where Sonnet 5 costs 4,000 × 3 + 1,200 × 15 = $30,000.00 and Claude Haiku 4.5 costs 4,000 + 6,000 = $10,000.00, and the annual gap between two mid-tier choices runs into six figures.

Input and output are different products

Every model in the table charges 5x to 6x more for output than input, because generation is sequential while reading is parallel: the model emits one output token per forward pass but ingests the whole prompt in one. That asymmetry means your workload's shape matters as much as its size. At the defaults, input is 75 percent of your tokens but only 37.5 percent of your Opus 4.8 bill: $600.00 of input against $1,000.00 of output. A retrieval-augmented application inverts the ratio further, stuffing several thousand tokens of fetched context into each request to get a two-sentence answer back, so its bill tracks the input rate almost entirely; code generation and long-form writing do the opposite. Before comparing providers, check which rate your own traffic keys on, because a model with cheap input and expensive output can beat a nominally cheaper rival on retrieval work and lose badly on generation.

What the estimate leaves out

This is a list-price ceiling, not a forecast of your invoice. Prompt caching is the biggest omission: all three providers discount input tokens that repeat across requests, with Anthropic billing cache reads at roughly a tenth of the normal input rate, so an application with a long shared system prompt can cut input cost by half or more. Batch processing is the second: a 50 percent discount for asynchronous jobs with results inside 24 hours is the common shape across OpenAI, Anthropic, and Google. Both are excluded because cache hit rates and batch eligibility vary too much between workloads to assume a number honestly. Long context cuts the other way: Google charges double for Gemini 3.1 Pro input above 200,000 tokens, $4 per million instead of $2, so a very-long-prompt workload can land above the table rather than below it. Also outside the model are free tiers, negotiated enterprise rates, fine-tuned model surcharges, and rate limits that may push traffic onto a second model regardless of price. If your workload is cache-friendly or latency-insensitive and your prompts stay inside each provider's standard context tier, read the table as an upper bound and expect to land below it.

Prices change without notice and figures here are estimates, not quotes; this site is not affiliated with any provider named above. See the site disclaimer.

Frequently asked questions

How much does the Claude API cost in 2026?

Per Anthropic's published rates, Claude Fable 5 is $10 per million input tokens and $50 per million output, Claude Opus 4.8 is $5/$25, Claude Sonnet 5 carries a $3/$15 sticker price, and Claude Haiku 4.5 is $1/$5. Sonnet 5 also has an introductory rate of $2/$10 that runs through August 2026, after which the standard $3/$15 applies.

What did GPT-4o cost before it was retired?

GPT-4o's final list price was $2.50 per million input tokens and $10 per million output tokens. Its closest current successor by position in OpenAI's lineup is GPT-5.6 Terra at $2.50 input and $15 output, so replacing a GPT-4o workload today costs the same on input and 50 percent more on output.

What did Claude 3.5 Sonnet cost?

Claude 3.5 Sonnet was priced at $3 per million input tokens and $15 per million output for its entire run, until Anthropic retired it in October 2025. Its successor, Claude Sonnet 5, has the same $3/$15 sticker, so old cost models built on 3.5 Sonnet numbers still land close, ignoring the temporary $2/$10 intro rate.

What was Gemini 1.5 Pro's API pricing?

Gemini 1.5 Pro cost $1.25 per million input tokens and $5 per million output for prompts up to 128k tokens, with both rates doubling on longer prompts. Google's current Gemini 3.1 Pro sits at $2 input and $12 output, so a short-prompt workload costs more than it did on 1.5 Pro.

Why do output tokens cost 5 to 6 times more than input tokens?

Generation is sequential: the model produces one token per forward pass, while input tokens are processed in parallel in a single pass. Every model in this calculator prices that difference at a 5x or 6x multiple, from Claude Opus 4.8 at $5 in and $25 out to GPT-5.6 Sol at $5 in and $30 out. Workloads that read a lot and write a little are cheap per token; workloads that write a lot are not.

How many tokens does a typical API request use?

A token is roughly four characters of English, so 1,000 tokens is about 750 words. The defaults here, 1,200 input and 400 output tokens, model a chat request with a moderate system prompt and a few paragraphs of answer. RAG requests often run 3,000 to 8,000 input tokens because retrieved documents ride along, while classification calls can be under 200 in each direction.