BrowserTools
Home / AI / AI API Cost Calculator

AI API Cost Calculator

Find out what an AI model will cost you per request, per day and per month, and compare the main providers side by side.

Loading AI API Cost Calculator… If nothing happens, please enable JavaScript.

Large language model APIs are billed by the token, a chunk of text that is usually a short word or a piece of a longer one. Every provider publishes a price per million tokens, and every request you send has two meters running: the input tokens you send (system prompt, conversation history, retrieved documents, tool definitions) and the output tokens the model writes back. This calculator takes the size of a typical request and how many of them you send, multiplies them against a table of current list prices, and shows the cost per request, per day and per month for every model at once, sorted so the cheapest option is at the top.

Frequently asked questions

What is a token and how many words is it?
A token is the unit a model reads and writes, produced by a tokenizer that splits text into common fragments. For ordinary English text a token is roughly three quarters of a word, or about four characters, so 1,000 tokens is about 750 words. Code, numbers, non-English languages and unusual formatting split into more tokens, which is why the word and character options here are labelled approximate.
Why do output tokens cost more than input tokens?
The model can process all of your prompt in parallel, but it has to generate its answer one token at a time, with a full pass through the network for each one. That makes output far more expensive to serve, and providers price it accordingly, typically several times the input rate. Keeping answers short, or asking for structured output instead of prose, is often the quickest way to lower a bill.
What does the cached input share mean?
With prompt caching the provider stores the processed form of a prompt prefix and reuses it on later calls, billing those tokens at a much lower cache-read rate. If your system prompt and reference material make up 80% of every request and only the user question changes, enter 80. Caches expire after a few minutes of inactivity and some providers charge extra to write to the cache, so treat the result as a best case for steady traffic.
When should I use a Batch API?
Whenever nobody is waiting for the answer. Batch endpoints take a file of requests and return the results asynchronously, usually within 24 hours, at around half the normal price. They suit evaluation runs, bulk classification, data extraction, translation of large catalogues and overnight reports. Tick the Batch API box to see the discounted cost; models from providers without a published batch discount stay at their standard rate and are labelled no batch.
Do reasoning or thinking tokens count as output?
Yes, for the providers covered here the internal reasoning a model does before answering is billed at the output rate, even when you only see a short final answer. A request that returns 300 visible tokens may bill several thousand if the model thought at length. Measure a few real calls and use the total output usage the API reports, not just the length of the visible reply.
Why does the price of a model jump for very long prompts?
Several providers use a two-tier price list in which prompts above a size threshold are billed at a higher rate for both input and output, because attention over very long contexts costs more to compute. When your input per request crosses that threshold the calculator switches the affected models to their long-context tier and marks the row, so you can see whether splitting documents into smaller chunks would be cheaper.
How accurate are these estimates?
The arithmetic is exact for the numbers you enter, but a real invoice depends on things a calculator cannot see: how many tokens your text actually becomes, retries, tool definitions and images, cache hit rates, regional or priority pricing, and taxes. The prices come from each provider's public list, reviewed on the date shown under the table, and they change often. Use the result to compare models and size a budget, then confirm against the provider's pricing page and your usage dashboard.
Is my data sent anywhere?
No. The price table is part of the page and all the calculations run in your browser. The tool never calls any AI provider, so you can model confidential workloads without anything leaving your device.

About AI API Cost Calculator

Input and output are priced very differently. Output tokens usually cost several times more than input tokens, because generating text one token at a time is far more expensive for the provider than reading a prompt in parallel. That changes which model wins: an application that sends long documents and asks for a one-line answer is dominated by the input rate, while a writing assistant that produces pages of text is dominated by the output rate. Reasoning models add a further twist, since the hidden thinking they do before answering is normally billed as output, so the output figure you enter should include it. Some providers also charge a higher rate once a prompt passes a size threshold, and the table switches those models to the long-context tier automatically when your input is large enough.

Two discounts can cut a bill dramatically. Prompt caching lets a provider reuse the part of a prompt that repeats between calls, such as a long system prompt or a document you ask several questions about, and cached input tokens are billed at a small fraction of the normal rate. Set the cached share to the percentage of each prompt that stays identical from call to call. Batch APIs accept a file of requests, process them within roughly a day instead of instantly, and charge about half price in return, which suits evaluations, classification jobs and nightly summaries. If you do not know your token counts, switch the unit to words or characters for a rough estimate, or paste real text into the Token Counter for an exact figure. Everything is calculated in your browser, and the price table shows the date it was last reviewed.

Why a token is not a word

Most modern models read text through byte pair encoding, a technique first described in 1994 as a way to compress data. It starts with single characters and repeatedly merges the pair that appears most often in a training corpus, so frequent words end up as a single token while rare words are assembled from several pieces. The result is a fixed vocabulary, typically between 50,000 and 250,000 entries, that can spell any text at all.

Because the vocabulary is learned mostly from English, the same sentence can cost very different amounts in different languages. A paragraph in Portuguese or German often needs noticeably more tokens than its English translation, and languages with non-Latin scripts can need several times as many. That is a real price difference on a per-token bill, and one reason newer tokenizers have grown larger vocabularies with more non-English entries.

Tokenization also explains some famous model quirks. A model that sees the word strawberry as two or three chunks never looks at the individual letters, which is why counting the r's used to trip up otherwise capable systems. Numbers split into odd groups of digits for the same reason, which made arithmetic harder for early models than it looked.

Support