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?
Why do output tokens cost more than input tokens?
What does the cached input share mean?
When should I use a Batch API?
Do reasoning or thinking tokens count as output?
Why does the price of a model jump for very long prompts?
How accurate are these estimates?
Is my data sent anywhere?
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.