Calculate the cost of using an AI model (GPT, Claude, Gemini, or any other) from your input/output token counts and your own current per-million-token prices — works for any provider, and never goes out of date.
📂 Technology & InternetEverything runs locally in your browser — no sign-up required, and no data is ever sent anywhere.
AI language models don't bill by the word or the character — they bill by the "token," a chunk of text roughly equivalent to about three-quarters of an English word on average, produced by breaking text apart with a tokenizer before it reaches the model. Because a single request typically involves both a prompt sent to the model (the input tokens) and a response generated by the model (the output tokens), and because generating new text token-by-token is generally more computationally expensive than reading existing text, most providers — including OpenAI, Anthropic, and Google — publish two separate prices per million tokens: one for input and a higher one for output. Multiplying each token count by its own per-million price and adding the two together gives the cost of a single request; multiplying that by how many requests you expect to make gives a realistic budget estimate for a feature, a script, or a month of usage. Because these per-million prices change relatively often as providers release new models and adjust pricing tiers, this calculator deliberately asks you to enter today's real price from your provider's own pricing page rather than assuming a fixed number that would quickly become inaccurate.
Anyone who has called an AI model's API and later received a bill has run into the same unit of measurement: the token. Tokens are the small chunks — often close to a word, sometimes a few characters, sometimes a whole common word — that a model's tokenizer splits text into before processing it, and it's these tokens, not raw characters or words, that AI providers actually meter and bill for.
Providers quote prices "per million tokens" simply because a single token is worth a tiny, awkward fraction of a cent — quoting a price per million turns that fraction into a normal, readable number like $3.00 or $15.00 that's easy to compare across providers and models. To get the actual cost of a specific request, you divide your token count by one million and multiply by that per-million price, then repeat for both input and output and add the two together.
The split between input and output pricing surprises people the first time they see it. Reading and encoding a prompt (the input) is comparatively cheap for a model to process, while generating a response (the output) happens one token at a time, each one depending on everything generated before it — a fundamentally more expensive computation. That's why most providers, across essentially every major AI model family, price output tokens noticeably higher than input tokens, sometimes three to five times higher.
None of this stays fixed for long. AI providers release new model versions, retire older ones, and revise pricing tiers on a timescale of months, not years, which is exactly why a calculator that hard-codes "GPT costs $X" or "Claude costs $Y" is doing its users a disservice the moment those prices change. This tool asks for your own current price instead, and lets you save a named entry for each provider or model you use regularly — stored only in your own browser — so checking the price once and reusing it is a one-time task, not something you repeat on every visit.
Estimating cost before building matters most at the planning stage: multiplying a single request's cost by an expected daily or monthly request volume, using the optional "number of requests" field here, turns an abstract per-token price into a concrete budget figure — useful whether you're comparing providers for a new project, sizing the cost of a chatbot feature, or estimating what a batch-processing script will cost to run against a large dataset before you actually run it.
Cost = (input tokens ÷ 1,000,000 × price per million input tokens) + (output tokens ÷ 1,000,000 × price per million output tokens). If you're estimating multiple requests, that per-request cost is then multiplied by the number of requests.
Check your provider's official pricing page (OpenAI, Anthropic, Google, or any other). This calculator deliberately does not store any provider's prices internally, since AI pricing changes often and a hardcoded number would quickly become inaccurate — you always enter today's real price yourself.
Processing input (prompt) tokens is generally cheaper than generating output (completion) tokens, since generation happens step-by-step and requires more computation per token, so most providers charge a higher price per million for output tokens than for input tokens.
Yes. Enter a name for the provider or model along with its input/output prices and press "Save pricing" — it's stored only in your browser's local storage (never sent anywhere) and appears in the saved-pricing list so you can load it again instantly next time.