GGetWebTool

AI & Cost

AI Token Cost Calculator

Estimate OpenAI, Claude, Gemini, and DeepSeek API costs from input/output tokens. Compare models side by side.

100% client-side · Data never leaves your device · Free forever

Optional: estimate tokens from sample text

Estimated total cost

$0.00

Per request
$0.00
Input cost
$0.00
Cached input cost
$0.00
Output cost
$0.00

Total tokens (in+out): 0· Requests: 0

Compare all models (same usage)

ProviderModelPer requestTotal

Cheapest option is highlighted. Prices are USD list rates for planning.

How to use the AI token cost calculator

  1. Select a model from OpenAI, Anthropic, Google, DeepSeek, or Mistral.
  2. Enter expected input tokens (prompt + context) and output tokens (completion).
  3. Optionally set cached input tokens if your provider discounts prompt caching.
  4. Set number of requests (for example 1,000 chat turns or batch jobs).
  5. Read the total USD estimate, per-request cost, and the side-by-side model comparison.

What is an AI token?

Large language models do not bill by character or word. They bill by tokens — sub-word units produced by a tokenizer. In English, one token is often about 4 characters or roughly ¾ of a word, but code, non-English text, and punctuation can differ a lot.

API invoices almost always split input (everything you send) andoutput (everything the model generates). Output is usually priced higher because generation is more expensive to serve.

Token cost formula

For a single request without caching:

cost = (inputTokens / 1,000,000 × inputUSD) + (outputTokens / 1,000,000 × outputUSD)

With cached input tokens (when the provider supports a cache rate):

cost = ((input − cached) / 1M × inputUSD) + (cached / 1M × cachedUSD) + (output / 1M × outputUSD)

Multiply by the number of requests to project monthly or campaign spend.

Reference pricing table (USD per 1M tokens)

Snapshot used by this calculator for planning. Always verify on the provider’s official pricing page.

ProviderModelInput / 1MOutput / 1MCached in / 1M
OpenAIGPT-4o$2.5$10$1.25
OpenAIGPT-4o mini$0.15$0.6$0.075
OpenAIGPT-4.1$2$8$0.5
OpenAIGPT-4.1 mini$0.4$1.6$0.1
OpenAIo3$2$8$0.5
OpenAIo4-mini$1.1$4.4$0.275
AnthropicClaude Sonnet 4$3$15$0.3
AnthropicClaude Opus 4$15$75$1.5
AnthropicClaude 3.5 Haiku$0.8$4$0.08
GoogleGemini 2.5 Pro$1.25$10$0.315
GoogleGemini 2.5 Flash$0.15$0.6$0.0375
GoogleGemini 2.0 Flash$0.1$0.4$0.025
DeepSeekDeepSeek V3$0.27$1.1$0.07
DeepSeekDeepSeek R1$0.55$2.19$0.14
MistralMistral Large$2$6
MistralMistral Small$0.1$0.3

Example: 1,000 customer-support replies

Suppose each ticket uses about 1,500 input tokens and500 output tokens, and you process 1,000 requests.

  • On a low-cost mini/flash model, total spend may stay well under a few dollars.
  • On a flagship frontier model, the same volume can be tens or hundreds of dollars.

Use the comparison table above the fold to see the spread instantly before you lock architecture choices (which model, how much context, whether to enable prompt caching).

Tips to reduce LLM API cost

  • Trim system prompts and retrieve only the context you need (RAG over huge dumps).
  • Prefer smaller models for classification/routing; reserve large models for hard steps.
  • Enable prompt caching when the same prefix is reused across calls.
  • Cap max_tokens so runaway completions cannot inflate output billing.
  • Log real token usage from the API and reconcile against this estimator weekly.

Why calculate token cost before shipping?

Token pricing looks tiny per call and expensive at product scale. A calculator turns vague “AI features” into a concrete unit economy: cost per chat, per document, per user, per month. That is essential for pricing your own SaaS, picking providers, and avoiding surprise invoices.

Frequently asked questions

How is AI API token cost calculated?+

Most providers bill separately for input (prompt) tokens and output (completion) tokens, usually per 1 million tokens. Cost = (inputTokens / 1,000,000 × inputPrice) + (outputTokens / 1,000,000 × outputPrice). Cached input tokens may use a discounted rate when supported.

What is the difference between input and output tokens?+

Input tokens are the text you send to the model (system prompt, user message, tools, context). Output tokens are the model’s generated reply. Output tokens are typically more expensive than input tokens.

How accurate is the text-to-token estimate?+

The optional text estimator uses ~4 characters per token, which is a common English approximation. Real token counts depend on the model tokenizer (BPE/SentencePiece). For billing-critical work, count tokens with the provider’s tokenizer.

Does this calculator send my data to a server?+

No. GetWebTool runs entirely in your browser. Pricing tables and math execute client-side. Nothing you type is uploaded for calculation.

Are the model prices up to date?+

Prices are maintained as a practical snapshot for planning. Providers change rates often—always confirm on the official OpenAI, Anthropic, Google, DeepSeek, or Mistral pricing pages before production budgeting.

Can I use this calculator from Claude or Cursor via MCP?+

Yes. GetWebTool is designed so each utility can be exposed as an MCP tool with the same core logic. See the MCP page for connection details.