New: AI API Cost Calculator — compare GPT, Claude, Gemini, Grok & Llama pricing live
Free Tool

AI API Cost Calculator

Toggle between OpenAI, Anthropic, Google, xAI and Meta — pick a model tier, enter your usage, and watch the cost update live. No signup, everything runs in your browser.

Your usage

—
$0
estimated per month
$0
per request
$0
per day
$0
per year

Live comparison — all 5 providers

Same usage, side by side. Updates instantly as you type.

Pricing verified October 2026 from provider pricing pages and API docs (per 1M tokens, standard tier, USD). Rates refresh daily at midnight US Eastern. Prices change — always confirm on the provider's own pricing page before budgeting. Estimates exclude prompt caching, batch discounts and taxes. Cached input is typically ~90% cheaper where supported.

How the math works

Every API call costs (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price). Output tokens cost 3–6× more than input because generation is compute-heavy. The sneaky part for agents: retries and tool calls multiply the bill — a task that needs three attempts costs roughly 3× your single-call estimate, and each search or code-execution tool call adds its own token load on top. The calculator above models the clean call; size your budget for real-world failure rates.

FAQ

Why is output priced higher than input?

Generating tokens costs providers more compute than reading them. Output rates run roughly 3–6× input rates across providers.

How do I cut my API bill?

Route simple tasks to mini/flash-tier models, enable prompt caching for repeated system prompts, use batch APIs for non-urgent work (up to 50% off), and cap max output tokens aggressively.

Which provider is cheapest?

It depends on the tier. Budget tiers (GPT-6 Luna, Gemini Flash-Lite) cost cents per million tokens; flagships (GPT-6 Astra, Claude Fable 5.1) cost 100× more. Toggle above with your real usage to see.

Why is Meta priced via Together AI?

Meta gives Llama away as open weights and sells no API directly. To use Llama via API you pay a hosting provider — Together AI is one of the most popular, and its rates are what the Meta tab uses.

How do I estimate cost per AI agent task?

Take your single-call cost and divide by the task success rate — a task that succeeds 70% of the time costs roughly 1.4× one clean call. Then add the token cost of every tool call (search, code execution, database lookups), which often exceeds the LLM inference itself. Size for real-world failure rates, not the happy path.