Token Calculator

302.AI Token Calculator

Instantly estimate API costs for 500+ models including GPT, Claude, and Gemini. Plan your AI budget — free, no sign-up.

Calculator

Cost estimate

Estimate LLM API cost from token usage and compare model pricing side by side

Input
129 words · about 156 tokens
Expected output length

Estimated for a typical task. Adjust it if you need to.

≈
Cache usage (optional)

Cache is billed on the input side, for prompts reused across calls

Compare other models with the same usage

Select models and compare the price for the current usage

ModelPriceCache pricePer call100 turnsRelative priceAction

Token counts are estimated with OpenAI tiktoken; Rates: 1 USD = 1 CNY, 1 USD = 1 JPY, 1 USD = 1 RUB. Exchange rates are for reference only. Settlement uses the live rate.

There may be a cheaper option

A value ranking matched to this usage, so you can see what costs more

View
Tokens

What is a token?

How tokens work and how they are billed

Step 1 · What is a token

Token · 词元

The basic unit a model reads.

It is neither a Chinese character nor an English letter. Each model has its own way of splitting text: common pieces stay whole, rare pieces are split further. The same sentence can have a different token count in different models.

unbelievableunbelievable
今天真不错今天真不错
model_idmodel_id

Illustration only. Step 3 uses a local mock and is not real tokenization.

FAQ

FAQ

Common questions about tokens and cost calculation

What is a token, and how does it relate to word count?
A token is the basic unit a model reads. It is neither a Chinese character nor an English letter. Common pieces stay whole; rare pieces are split further. Roughly, 1 Chinese character ≈ 1–2 tokens and 1 English word ≈ 1–1.3 tokens, depending on the tokenizer. The section below lets you split a sample yourself.
Are the token counts on this calculator accurate?
Text mode counts tokens locally with OpenAI tiktoken (cl100k_base) and does not upload the text. It is an estimate: other models use different tokenizers, so it should not be used to reconcile a bill. The splits and IDs in “What is a token” are still a demo.
Why are input and output billed separately?
Mainstream APIs bill content sent to the model (input) and content generated by the model (output) at different rates. Output is usually 3–5× more expensive because generation costs more. Output length often affects the total more than input length.
What are cache tokens, and can they save money?
If you resend the same long prompt, such as a fixed system prompt, some models can cache it and bill later reads at a lower rate. This helps when the system prompt is long and calls are frequent. It does not help when every message is different.
Are model prices live?
Model names and prices come from the language-model catalog. When a model has multiple prices, the first one is used. Currency conversion uses the live rates from the pricing page.
What makes up the cost of one request?
The full context includes the system prompt, conversation history, uploaded documents, tool results, and your current input, plus space reserved for the output. Together they cannot exceed the model’s context limit. Step 4 shows how much each part takes.