AI API Cost Calculator

Free AI API cost calculator: paste your prompt → compare estimated tokens and LLM API pricing across OpenAI, Anthropic, Google, and Groq.

Prompt input and token statistics

Token count (est.)

0

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 costOutput costTotalAction
GPT-4oCheapest
OpenAI128K$0.00$0.00$0.00Get API Key →
GPT-4o miniCheapest
OpenAI128K$0.00$0.00$0.00Get API Key →
Claude Sonnet 4.5Cheapest
Anthropic200K$0.00$0.00$0.00Get API Key →
Claude Haiku 3.5Cheapest
Anthropic200K$0.00$0.00$0.00Get API Key →
Gemini 2.5 ProCheapest
Google1.0M$0.00$0.00$0.00Get API Key →
Gemini 2.5 FlashCheapest
Google1.0M$0.00$0.00$0.00Get API Key →
Llama 3.3 70B via GroqCheapest
Meta via Groq131K$0.00$0.00$0.00Get API Key →

Batch Cost Estimator

How much will this prompt cost at scale?

1100,000

GPT-4o

OpenAI
Daily
$0.00
Monthly
$0.00

GPT-4o mini

OpenAI
Daily
$0.00
Monthly
$0.00

Claude Sonnet 4.5

Anthropic
Daily
$0.00
Monthly
$0.00

Claude Haiku 3.5

Anthropic
Daily
$0.00
Monthly
$0.00

Gemini 2.5 Pro

Google
Daily
$0.00
Monthly
$0.00

Gemini 2.5 Flash

Google
Daily
$0.00
Monthly
$0.00

Llama 3.3 70B via Groq

Meta via Groq
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?

The tool shows a rough token count using characters divided by four, which is a common fast approximation. Actual tokenization depends on the model and tokenizer; use provider tokenizers for billing-critical workloads.

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?

No backend or database is required for the calculator: prompts are processed in your browser for counting and cost math. Do not paste secrets or confidential data into any third-party website.