Developer Tools

Claude vs GPT vs Gemini API Cost Calculator

Enter how many tokens each request uses and how many requests you expect each month, and see what the same workload costs on Claude, OpenAI and Gemini models, cheapest first. Prices come from each provider's own pricing page and are dated below the results. Nothing you type leaves your browser.

Claude vs GPT vs Gemini API Cost Calculator

Free · No sign-up
Loading tool…

How AI API pricing works

Claude, GPT and Gemini all bill by the token, which is a small piece of text, roughly four characters of English. Providers publish a price for one million tokens, and they charge separately for what you send (input) and what the model writes back (output). In the price tables this calculator uses, output costs several times as much as input, so a model that writes long answers gets expensive faster than one that reads long documents.

The sum is simple: input tokens divided by a million and multiplied by the input price, plus output tokens divided by a million and multiplied by the output price. Then multiply by the number of requests. The calculator does that for every model at once, so you can see the spread between a small model and a top-end one for your own numbers.

What counts as input tokens

People often count only the question they typed. The bill counts everything sent with it: the system prompt, the conversation so far, any documents or search results you attach, and the tool definitions. In a chatbot, each new turn sends the earlier turns again, so input grows as the conversation goes on. If you are guessing, take a real conversation, paste it into the sample box and use that number.

For output, remember that some models spend extra tokens thinking before they answer. Google's pricing page says Gemini's thinking tokens are billed as output tokens, so a short visible answer can still cost more than its length suggests.

Prompt caching and the cached share

When the start of your prompt is the same on every request, such as a long system prompt or a fixed document, providers can serve it from a cache at a much lower price. The cached share field is the part of your input you expect to be read from the cache. Leave it at 0 if you are not sure, because the saving only happens when your requests are built to reuse the same prefix.

Caching has costs of its own. Anthropic charges extra to write to the cache, and Google charges for storing it by the hour. This calculator leaves those fees out and says so under the results, so use the cached share as an optimistic scenario and not a promise.

Why the cheapest model is not always the right one

A small model that costs a few dollars a month is no bargain if its answers are wrong half of the time. The usual approach is to test your own task on two or three models and choose the cheapest one that does the job well enough. Then use this page to see what that choice costs at your real volume, and what it would cost if your traffic grew ten times.

If you are new to how these models produce text at all, our explainer on how AI works covers tokens and prediction in plain words, and why most people use AI wrong shows where time and money usually go to waste.

Prices change, so check the date

AI prices move often. Every figure here was read from the Anthropic, OpenAI and Google pricing pages on the date printed under the results, and some models already have a new price scheduled. Those are flagged on the row, and the calculator switches to the new price on the day it starts. Large requests can also be priced differently: Claude Haiku 5.5 and Gemini 3.1 Pro Preview have a higher price for big prompts, which the calculator applies, and OpenAI models are priced here only up to 272,000 input tokens.

If a price has changed since, or your model is missing, use the own-prices box. It takes dollars per million tokens, so you can paste the numbers straight from the provider's page. For code that calls these APIs, our cURL to fetch converter turns a working request into a fetch call, and the CLAUDE.md and AGENTS.md generator helps you write the rules file for an AI coding assistant. More tools like these are in our free developer tools.

Frequently asked questions

How do I calculate the cost of an AI API request?

Divide the input tokens by one million and multiply by the model's input price, then do the same for the output tokens with the output price, and add the two. Multiply by your requests per month for the monthly cost. The calculator does this for every model at once.

Which is cheaper, Claude, GPT or Gemini?

It depends on the model and on your input and output sizes. Each provider has small, cheap models and large, expensive ones, and the ranking changes with your numbers. Enter your usage and the list sorts itself from cheapest to most expensive.

How many tokens is my prompt?

In English, about one token for every four characters, so 1,000 characters is roughly 250 tokens. Paste your prompt in the sample box for an estimate. Code, JSON and other languages usually use more tokens, and each provider counts them in its own way.

Are these prices up to date?

They were read from each provider's pricing page on the date shown under the results. Prices change, so confirm on the provider's page before you budget. If a price has changed, enter the new one in the own-prices box.

What does the cached share mean?

It is the part of your input that is read from the provider's prompt cache at a lower price. It only applies when requests start with the same text, such as a fixed system prompt. Leave it at 0 if you are not sure.

What is not included in the estimate?

Cache-write and storage fees, batch discounts, taxes, and extra charges for tools such as web search. Your invoice can therefore differ from the estimate.

Is anything I type sent to a server?

No. The calculation runs in your browser, and the prompt you paste is only used to count characters.