AI

AI Token & Cost Calculator

Paste prompt text or enter known token counts to estimate AI API costs across common text model pricing presets and custom per-token rates.

App view

Inputs

Pricing presetChoose a provider/model or enter rates
Token usageEstimate from text or use known counts
Runs and outputScale the result across repeated requests
Results update automatically

Results

Result Enter values to calculate.
Your result explanation will appear here.

Useful next checks

  • Check the inputs before relying on the result.
  • Try a second scenario to compare outcomes.
  • Read the guide below for context.

# AI Token & Cost Calculator

Use this AI token and cost calculator to estimate how much a text prompt and response could cost across common AI API pricing presets or your own custom token rates.

What this calculator does

The calculator estimates input tokens, output tokens, cost per run, and total cost across repeated requests. You can paste text for a rough token estimate, enter exact input token counts from API logs, choose an expected output length, and compare provider/model pricing presets.

How it works

Most AI text APIs charge separately for input tokens and output tokens. Input tokens are the prompt, system instructions, conversation history, retrieved context, tool definitions, and any other text sent to the model. Output tokens are the text the model generates.

The standard cost formula is:

`input cost = input tokens / 1,000,000 x input price per 1M tokens`

`output cost = output tokens / 1,000,000 x output price per 1M tokens`

`total cost = (input cost + output cost) x runs`

When you paste text, this calculator uses a rough estimate of about one token per four characters. When you estimate output from words, it uses about 1.33 tokens per word.

Example calculation

Suppose a prompt uses 750 input tokens, the answer is expected to use 500 output tokens, and the selected model costs $0.75 per 1M input tokens and $4.50 per 1M output tokens.

The input cost is `750 / 1,000,000 x 0.75 = $0.0005625`. The output cost is `500 / 1,000,000 x 4.50 = $0.00225`. One run is about `$0.0028125`, so 1,000 runs would cost about `$2.81` before any discounts, taxes, or extra tool charges.

How to use the result

Use the total cost as a planning estimate when comparing prompt sizes, model choices, and expected request volume. If you are budgeting a real product, replace the rough estimate with actual `input_tokens` and `output_tokens` from your provider's API response or usage dashboard.

Assumptions and limitations

This V1 calculator covers standard text input and output token pricing only. It does not include cached-token discounts, batch pricing, priority/flex pricing, tool calls, web search, code execution, images, audio, fine-tuning, regional processing uplifts, taxes, free tiers, or account-specific discounts.

Static model prices can change. The calculator includes a last-checked date in the result and custom-rate fields for any provider, region, or model that does not match the preset.

FAQs

How accurate is the token estimate?

It is useful for planning, not exact billing. Different providers and models use different tokenizers, and some add hidden or system tokens. Use exact API usage data when precision matters.

Why are input and output prices different?

Output tokens often cost more because the model generates them one step at a time. Input tokens are read as context, while output tokens require generation work.

Does this include cached tokens or tools?

No. The result excludes cache discounts, batch pricing, hosted tools, search, images, audio, taxes, and account-specific discounts. Add those separately if they apply to your workload.

Related calculators

Frequently asked questions

How accurate is the token estimate?

It is a rough planning estimate. Different models use different tokenizers, so exact counts should come from provider token tools or API usage data.

Why are input and output prices different?

Generated output usually costs more because the model must produce those tokens step by step, while input tokens are read as context.

Does this include cached tokens or tools?

No. V1 estimates standard text input and output token charges only. It excludes cache discounts, batch pricing, tools, search, images, audio, taxes, and account-specific discounts.