Quick access

Saved in this browser. Sign in to keep it on all your devices.

AI Token & Cost Calculator

Paste a prompt to count its tokens and compare what it costs on GPT, Claude, and Gemini models. Set the reply length and number of requests to estimate a monthly API bill. Prices checked October 15, 2026. Your text never leaves your browser.

Tokens
0
Words
0
Characters
0

Counted with OpenAI's o200k_base tokenizer, loaded when you start typing.

0%

If you resend the same system prompt or document, most providers bill the repeated part at a lower cache price.

Cost for 1 request

AI API prices per 1 million tokens

Standard pay-as-you-go prices in US dollars, checked October 15, 2026. Batch and priority tiers cost differently.

Model Input Cached Output Context 1K in + 500 out
GPT-6 Astra $10 $1 $50 1.05M $0.035
GPT-6.1 Sol $2 $0.10 $10 1.05M $0.007
GPT-6 Luna $0.10 $0.01 $0.50 1.05M $0.00035
GPT-5 $1.25 $0.125 $10 400K $0.00625
GPT-5 mini $0.25 $0.025 $2 400K $0.00125
GPT-5 nano $0.05 $0.005 $0.40 400K $0.00025
GPT-4.1 mini $0.40 $0.10 $1.60 1.05M $0.0012
GPT-4o mini $0.15 $0.075 $0.60 128K $0.00045
Claude Fable 5.1 $10 $0.25 $50 1M $0.035
Claude Opus 5.5 $4 $0.20 $20 1M $0.014
Claude Sonnet 5.5 $2 $0.20 $10 1M $0.007
Claude Haiku 5.5 $0.10 — $0.50 1M $0.00035
Claude Haiku 4.5 $1 $0.10 $5 200K $0.0035
Gemini 4 Argon price rises Dec 1 $2 $0.10 $10 1.05M $0.007
Gemini 3.1 Pro (preview) $2 $0.20 $12 1.05M $0.008
Gemini 3.8 Flash price rises Jan 1 $0.75 $0.075 $3.75 1.05M $0.002625
Gemini 3.5 Flash-Lite $0.30 $0.03 $2.50 1.05M $0.00155

Sources: OpenAI pricing, Anthropic pricing, Google pricing. Always confirm on the provider's page before you budget.

Version 1.1 Updated What's new

Release notes

  1. v1.1 Latest
    • Added an in-depth guide below the tool, written from what the tool actually does.

About the AI Token & Cost Calculator

AI APIs bill by the token, and every model charges a different price for the text you send and the text it writes back. Paste a prompt to count its tokens, set how long the replies are and how many requests you make, and see the cost on each model, cheapest first. Prices come from each provider's pricing page and show the date they were last checked.

How to use it

  1. 1 Paste your prompt, system prompt, or document.
  2. 2 Set the reply length and the number of requests, and how much of the prompt is cached.
  3. 3 Compare the cost on each model, or open a model for its full price details.

Frequently asked questions

What is a token?

A token is a piece of text the model reads or writes: often a whole short word, part of a longer word, or a punctuation mark. In English, one token is about four characters or three quarters of a word. Bangla, Hindi, Chinese, and other scripts usually need more tokens for the same meaning.

Are the token counts exact?

They are exact for GPT-5, GPT-4.1, and GPT-4o, which use the public o200k_base tokenizer. Anthropic, Google, and the GPT-6 models have not published their tokenizers, so counts for those models are estimates and can differ by roughly 10 to 30 percent. Use the provider's token-counting API when you need an exact figure.

Why do output tokens cost more than input tokens?

Writing each output token takes a full pass through the model, while the prompt can be read in parallel. Providers price that extra work in, so output usually costs four to eight times as much as input.

What is prompt caching?

When you send the same long beginning of a prompt again, such as a system prompt or a document, providers can reuse their earlier work and bill that part at a much lower cached-input price. Set the cached share to see how much it saves.

Is my prompt sent to a server?

No. Tokens are counted in your browser, so your text never leaves your device.

Working out the cost of one request

Providers quote prices per million tokens, with separate prices for input and output. Suppose a model charges $3 per million input tokens and $15 per million output tokens, and each request sends a 2,000-token prompt and gets a 500-token reply:

input:  2,000 ÷ 1,000,000 × $3  = $0.006
output:   500 ÷ 1,000,000 × $15 = $0.0075
total per request               = $0.0135
10,000 requests a month         ≈ $135

The calculator runs the same sum for every model at once, so you can see how much the choice of model changes the bill.

What makes a bill bigger than expected

  • Chat history: each new message sends the whole conversation again, so a long chat costs more per turn the longer it runs.
  • Reasoning tokens: models that think before they answer bill that hidden thinking as output tokens, often several times the length of the visible reply.
  • Long context: some models charge a higher rate once a prompt passes a certain size, such as 200,000 tokens.
  • Images and files: pictures and PDFs are turned into tokens too, and a full page can cost more than a page of plain text.

Ways to cut API costs

Use the smallest model that passes your tests, since small models often cost a tenth of the top ones or less. Keep the system prompt and fixed documents at the start of the prompt so caching can apply to them. Set a maximum output length, and ask for short answers when you don’t need long ones. For work that can wait, such as tagging a backlog of documents, the batch APIs of OpenAI, Anthropic and Google take a day or less and cost about half the normal price.

Checking the price before you ship

Prices here come from each provider’s pricing page, and the date they were last checked is shown with the table. Providers cut prices often and add new models every few months, so check the official page before signing a budget. Paste a real prompt from your app rather than a short test, because an estimate built on a ten-word question can be off by a factor of a hundred.