AI API Cost Calculator

Use this AI API cost calculator to compare token pricing across OpenAI, Anthropic, Google, Groq, and more — paste a prompt and see estimated tokens and per-model costs instantly.

Prompt input and token statistics

Token estimate mode

Tip: Switch to Accurate for provider-level token counts. Your text is sent to this site's server and forwarded to tokenizer APIs — nothing is stored (see Privacy).

Token count (fast)

0

Characters ÷ 4

Words

0

Characters

0

Estimated cost

See costs below ↓

Cost Comparison

Fetching latest public token rates (LiteLLM catalog)…

Bundled defaults for: GPT-4o, GPT-4o mini, Claude Sonnet 4.5, Claude Haiku 3.5, Gemini 2.5 Pro, Gemini 2.5 Flash, Llama 3.3 70B via Groq. The catalog does not always expose a stable chat row for every marketing name — verify on the provider site.

Output tokens assumed at 2× input tokens (typical chat ratio). Models marked Tiered use higher per-token rates beyond 128k or 200k input/output tokens when the catalog defines them.

Sort by
ModelProviderContextInput tokensInput costOutput costTotalAction
GPT-4oCheapest
OpenAI128K0$0.00$0.00$0.00Get API Key →
GPT-4o miniCheapest
OpenAI128K0$0.00$0.00$0.00Get API Key →
Claude Sonnet 4.5Cheapest
Anthropic200K0$0.00$0.00$0.00Get API Key →
Claude Haiku 3.5Cheapest
Anthropic200K0$0.00$0.00$0.00Get API Key →
Gemini 2.5 ProCheapest
Google1.0M0$0.00$0.00$0.00Get API Key →
Gemini 2.5 FlashCheapest
Google1.0M0$0.00$0.00$0.00Get API Key →
Llama 3.3 70B via GroqCheapest
Meta via Groq131K0$0.00$0.00$0.00Get API Key →

Batch Cost Estimator

How much will this prompt cost at scale?

1100,000

GPT-4o

OpenAI
Tokens / run
0
Daily
$0.00
Monthly
$0.00

GPT-4o mini

OpenAI
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Claude Sonnet 4.5

Anthropic
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Claude Haiku 3.5

Anthropic
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Gemini 2.5 Pro

Google
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Gemini 2.5 Flash

Google
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Llama 3.3 70B via Groq

Meta via Groq
Tokens / run
0
Daily
$0.00
Monthly
$0.00

Frequently asked questions

Quick answers for people searching for AI API cost calculators, token estimates, and LLM pricing comparisons.

What is an AI API cost calculator?

It estimates how much you would pay different AI providers based on your prompt size (tokens), using published per-token or per-million-token rates. It helps compare models before you integrate or scale.

How accurate are these AI API cost estimates?

Costs are indicative. Providers change prices, offer tiers, caching, and batch discounts. This tool uses reference rates and common assumptions (such as output size relative to input). Always confirm on the provider’s billing page before budgeting.

How are tokens estimated from my text?

By default (Fast mode), input tokens use a quick approximation: characters divided by four. In Accurate mode, the site sends your text to our server, which counts tokens the same way each provider does — OpenAI-compatible models use the o200k tokenizer locally; Claude and Gemini use their official token-count APIs when API keys are configured; Llama-style rows use a compatible local tokenizer. Actual billed tokens can still differ slightly due to chat formatting and provider billing rules.

Which AI models are supported?

The comparison includes major chat models from OpenAI (e.g. GPT-4o family), Anthropic Claude, Google Gemini, and Llama-class models on Groq, with rates refreshed from a public pricing catalog when available.

Does my prompt leave my browser?

Fast mode keeps counting fully in your browser. Accurate mode sends your pasted text to our server over HTTPS so we can call provider tokenizer endpoints (and local tokenizers where appropriate); prompts are not stored in a database by this app. Do not paste secrets or confidential data into any third-party website.