AI Pricing Calculator
Compare AI API pricing across GPT-5.5, Claude 4.7, Gemini 3, Llama, Grok and more. Per-request, daily, and monthly cost breakdowns.
This AI pricing calculator estimates and compares costs across 25 major language model APIs from OpenAI, Anthropic, Google, Meta (via Groq), Mistral, xAI, and DeepSeek. Enter your expected token usage and daily request volume to see per-request, daily, and monthly costs sorted from cheapest to most expensive, with a visual bar chart and detailed comparison table. All calculations run locally in your browser.
About AI Pricing Calculator
How AI API Pricing Works
Every major LLM provider charges per token processed. A token is a chunk of text - roughly 3 to 4 characters or about 0.75 words in English. Providers bill input tokens (your prompt, system message, and any context documents) and output tokens (the model's generated response) at different rates. Output tokens typically cost 2 to 6 times more than input tokens because generation requires more compute than reading input.
The formula is straightforward:
Cost per request = (input tokens / 1,000,000 x input rate) + (output tokens / 1,000,000 x output rate)
Worked example: Sending 1,000 input tokens and 500 output tokens to GPT-5.5 costs (1,000 / 1,000,000 x $5.00) + (500 / 1,000,000 x $30.00) = $0.005 + $0.015 = $0.02 per request. At 1,000 requests per day, that is $20/day or $600/month. The same workload on Llama 3.1 8B Instant via Groq would cost (1,000 / 1,000,000 x $0.05) + (500 / 1,000,000 x $0.08) = $0.00009 per request, or about $2.70/month - a 99.5% saving for tasks where a small model is sufficient.
| Billing component | What it covers | Typical range (as of May 2026) |
|---|---|---|
| Input tokens | Prompt, system message, context documents, conversation history | $0.05 - $5.00 per million tokens |
| Output tokens | The model's generated response | $0.08 - $30.00 per million tokens |
| Request volume | Number of API calls per day | Varies by application |
Current Model Pricing Comparison (June 2026)
Prices change frequently as providers compete on cost. The table below reflects standard published API rates as of June 2026. For exact counts on your specific prompts, the AI token counter runs real tokeniser libraries in your browser.
| Provider | Model | Input (per 1M tokens) | Output (per 1M tokens) | Best for |
|---|---|---|---|---|
| OpenAI | GPT-5.5 | $5.00 | $30.00 | New flagship - top-end reasoning and multimodal tasks |
| OpenAI | GPT-5.4 | $2.50 | $15.00 | Previous flagship, strong coding and complex analysis |
| OpenAI | GPT-5.4 Mini | $0.75 | $4.50 | Mid-range tasks, good balance of cost and capability |
| OpenAI | GPT-5.4 Nano | $0.20 | $1.25 | High-volume simple tasks, classification, extraction |
| OpenAI | GPT-4.1 | $2.00 | $8.00 | Stable workhorse, strong coding performance |
| OpenAI | GPT-4.1 Mini | $0.20 | $0.80 | Budget-friendly general purpose |
| Anthropic | Claude Fable 5 | $10.00 | $50.00 | New Anthropic frontier model (GA 9 June 2026) - deepest reasoning |
| Anthropic | Claude Opus 4.8 | $5.00 | $25.00 | Current Opus flagship - nuanced reasoning, long agentic tasks |
| Anthropic | Claude Opus 4.7 | $5.00 | $25.00 | Previous Opus, still available |
| Anthropic | Claude Sonnet 4.6 | $3.00 | $15.00 | Complex reasoning, writing, coding |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | Fast, cost-effective for moderate tasks |
| Gemini 3.1 Pro Preview | $2.00* | $12.00* | New Gemini flagship, deep reasoning, long context (*standard tier, doubles above 200K tokens) | |
| Gemini 3.1 Flash-Lite | $0.25 | $1.50 | Fast Gemini 3 tier, multimodal at low cost | |
| Gemini 3 Flash Preview | $0.50 | $3.00 | Balanced Gemini 3 option, faster than 3.1 Pro | |
| Gemini 2.5 Pro | $1.25 | $10.00 | 1M-token context, multimodal, stable | |
| Gemini 2.5 Flash | $0.30 | $2.50 | Fast general purpose, good value | |
| Gemini 2.5 Flash-Lite | $0.10 | $0.40 | Ultra-cheap, simple tasks | |
| Meta (Groq) | Llama 4 Scout | $0.11 | $0.34 | Cheapest Llama 4, 128K context |
| Meta (Groq) | Llama 3.3 70B | $0.59 | $0.79 | Strong open-source workhorse, 128K context |
| Meta (Groq) | Llama 3.1 8B Instant | $0.05 | $0.08 | Lowest-cost capable model anywhere on the market |
| OpenAI OSS (Groq) | GPT-OSS 20B | $0.075 | $0.30 | OpenAI's smaller open-weights release, runs on Groq infra |
| OpenAI OSS (Groq) | GPT-OSS 120B | $0.15 | $0.60 | OpenAI's larger open-weights release |
| Alibaba (Groq) | Qwen3 32B | $0.29 | $0.59 | Strong Chinese and multilingual performance, 131K context |
| Mistral | Mistral Large 3 | $0.50 | $1.50 | European provider, EU data residency, multilingual |
| Mistral | Mistral Medium 3.5 | $1.50 | $7.50 | Newer mid-tier, stronger reasoning than Large 3 |
| Mistral | Mistral Small 4 | $0.15 | $0.60 | Budget multilingual, replaces Small 3.1 |
| xAI | Grok 4.3 | $1.25 | $2.50 | Real-time X data integration, mid-tier reasoning |
| DeepSeek | DeepSeek V4 Flash | $0.14 | $0.28 | Aggressive pricing from Chinese provider, strong on reasoning benchmarks |
LLM API prices dropped roughly 80% between early 2025 and early 2026 according to industry analysis. Always check each provider's official pricing page before committing to a model - rates can change without much notice. The Mistral Small 3.1 / Llama 4 Maverick entries from prior versions of this calculator were removed in May 2026 (Maverick delisted by Groq, Small 3.1 superseded by Small 4).
Real-World Cost Examples
The monthly bill for an AI feature depends heavily on the model chosen, the amount of context sent, and daily volume. Below are four common use cases calculated at both the cheapest available model (Llama 4 Scout via Groq) and a mid-tier option (GPT-5.4).
| Use case | Input tokens | Output tokens | Requests/day | Monthly (Llama 4 Scout) | Monthly (GPT-5.4) |
|---|---|---|---|---|---|
| Customer support chatbot | 500 | 200 | 1,000 | ~$3.69 | ~$127.50 |
| Document summarisation | 4,000 | 500 | 500 | ~$9.15 | ~$262.50 |
| Code generation assistant | 1,000 | 1,000 | 200 | ~$2.70 | ~$105.00 |
| Classification and extraction | 300 | 50 | 10,000 | ~$15.00 | ~$450.00 |
The cost gap between the cheapest and most capable models can be 30x or more for the same workload. For many production applications, that difference makes model routing - where simple requests go to a cheap model and only complex ones hit a premium model - the single most effective cost reduction strategy.
How to Reduce AI API Costs
Enterprise LLM API spending reached $8.4 billion globally by mid-2025 according to Ramp data, and 72% of enterprise IT leaders planned to increase LLM spending in 2026 according to a Typedef.ai survey. With budgets growing, cost optimisation matters more than ever. Here are the most effective strategies, ordered by typical impact.
| Strategy | Potential savings | How it works |
|---|---|---|
| Model routing | 50-80% | Route simple requests to a cheap model (GPT-5.4 Nano, Llama 4 Scout) and only send complex queries to premium models. Most production traffic is simple enough for small models. |
| Prompt caching | Up to 90% on cached input | Anthropic offers a 90% discount on cached input token prefixes. OpenAI offers a 75% discount on cached inputs for GPT-4.1 and GPT-5.4 models. Repeated system prompts and context blocks benefit most. |
| Batch processing | 50% | Both OpenAI and Anthropic offer half-price rates for non-real-time batch requests. Results are returned within 24 hours instead of immediately. |
| Shorter prompts | Proportional | Trim unnecessary context, compress conversation history, and use concise system prompts. Every token in your prompt costs money on every single request. |
| Output token limits | Significant | Set max_tokens in your API call to prevent verbose responses. Output tokens cost 2 to 5 times more than input tokens, so constraining output length has outsized impact. |
| Self-hosting open models | Variable | Llama 4 and Mistral models can run on your own GPUs at a fixed hardware cost. At high volume, self-hosting often beats API pricing, but requires DevOps overhead. |
How Many Tokens Does a Typical Request Use?
Token counts vary dramatically by use case. A short chatbot message might use 200 to 500 input tokens (including the system prompt), while a document analysis task could send 4,000 to 100,000 input tokens depending on document length. Code, JSON, and non-Latin scripts use more tokens per word than plain English text.
Here are some rough benchmarks for common content types:
| Content type | Approximate tokens per 1,000 words |
|---|---|
| English prose | ~1,300 tokens |
| Python code | ~1,800 tokens |
| JSON data | ~2,000 tokens |
| Minified HTML/CSS | ~2,500 tokens |
| Chinese/Japanese text | ~2,500-3,000 tokens |
For precise counts on your specific prompts and documents, the AI token counter runs GPT, Claude, and Llama tokenisers directly in your browser. Understanding your actual token usage is the first step to accurate cost forecasting.
Choosing the Right Model for Your Budget
Picking the cheapest model is not always the right call - a model that hallucinates on 5% of requests might cost more in debugging time and user trust than a pricier model that gets it right consistently. The right approach depends on the task complexity, acceptable error rate, and volume.
High-volume, simple tasks (classification, extraction, sentiment analysis, routing): Use the cheapest available model. Llama 3.1 8B Instant ($0.05/$0.08), GPT-OSS 20B ($0.075/$0.30), Gemini 2.5 Flash-Lite ($0.10/$0.40), Llama 4 Scout ($0.11/$0.34), or DeepSeek V4 Flash ($0.14/$0.28) all handle structured extraction well at a tiny fraction of the cost of premium models.
Mid-complexity tasks (content generation, code assistance, moderate reasoning): GPT-5.4 Mini ($0.75/$4.50), Claude Sonnet 4.6 ($3.00/$15.00), Gemini 3 Flash Preview ($0.50/$3.00), Mistral Small 4 ($0.15/$0.60), or Grok 4.3 ($1.25/$2.50) provide strong performance at reasonable cost. This tier handles most production workloads.
Complex reasoning, research, and critical tasks (legal analysis, medical Q&A, advanced coding, multi-step agentic work): GPT-5.5 ($5.00/$30.00), Claude Opus 4.7 ($5.00/$25.00), Gemini 3.1 Pro Preview ($2.00/$12.00 below 200K tokens), or GPT-5.4 ($2.50/$15.00) offer the highest accuracy. Reserve these for tasks where mistakes have real consequences.
If you are budgeting AI costs for a startup, the startup runway calculator can factor monthly API spend into your burn rate. For quantifying the business value of an AI feature against its cost, the ROI calculator helps frame the investment.
How Large Is the AI API Market?
The enterprise LLM market reached $8.19 billion in 2026 according to Fortune Business Insights, with projections reaching $48 to $71 billion by 2034 depending on the estimate. A Typedef.ai survey found 37% of enterprises invest over $250,000 annually on LLMs, while 73% spend more than $50,000 per year. Over 80% of enterprises are expected to have deployed generative AI applications or APIs by the end of 2026 according to Gartner. Large enterprises account for roughly 78% of total enterprise LLM spending, but smaller teams and startups are increasingly adopting API-based models rather than self-hosting, since pay-per-token pricing removes the need for upfront GPU investment.
This rapid growth in API spending - from $0.5 billion in 2023 to $8.4 billion by mid-2025 per Ramp data - is why accurate cost forecasting matters. A model choice that seems cheap at 100 requests per day can become a significant line item at 10,000 requests per day. Even small improvements in token efficiency - shorter system prompts, compressed context, or switching to a cheaper model for simple requests - compound into meaningful savings at scale. The AI model size calculator can help estimate the hardware requirements if you are considering self-hosting as an alternative to API access.
Sources
- OpenAI - API Pricing
- Anthropic - Claude API Pricing
- Google - Gemini API Pricing
- Groq - On-Demand Pricing
- Mistral AI - Pricing
- xAI - Models and Pricing
- DeepSeek - API Pricing
- Fortune Business Insights - Enterprise LLM Market Size
- Ramp - AI Infrastructure Spending Data
- Typedef.ai - LLM Adoption Statistics
Frequently Asked Questions
How are AI API costs calculated?
AI APIs charge based on tokens processed. A token is roughly 3/4 of a word in English. You pay separately for input tokens (what you send to the model) and output tokens (what it generates). The cost per request is the sum of (input tokens / 1M * input rate) + (output tokens / 1M * output rate). Multiply by requests per day and days per month for ongoing costs.
Why do prices vary so much between models?
Larger, more capable models cost more to run because they require more compute. A frontier model like Claude Fable 5, Claude Opus 4.8, or GPT-5.5 offers stronger reasoning but at a premium. Smaller models like GPT-5.4 Nano or Gemini 2.5 Flash-Lite are optimised for speed and cost, making them ideal for high-volume tasks that do not need top-tier reasoning.
What counts as a token?
A token is a chunk of text that the model processes. In English, one token is roughly 3 to 4 characters or about 0.75 words. Code, non-English text, and structured data like JSON tend to use more tokens per word. Most providers offer a tokenizer tool so you can check exact counts for your specific inputs.
Do these prices include volume discounts or cached tokens?
The prices shown are standard published API rates. Many providers offer lower rates for batched requests, prompt caching, and committed-use plans. For example, OpenAI offers up to 50% off with batch processing, and Anthropic offers a 90% reduction on cached input tokens plus 50% off with batch processing. Check each provider's pricing page for the latest discount tiers.
Which model should I choose for my use case?
It depends on your needs. For high-volume simple tasks like classification or extraction, small models like Llama 3.1 8B Instant, GPT-OSS 20B, or DeepSeek V4 Flash keep costs very low. For complex reasoning, coding, or nuanced writing, mid-tier models like GPT-5.4 Mini, Claude Sonnet 4.6, or Gemini 3 Flash offer a good balance. Only reach for premium models like Claude Fable 5, Claude Opus 4.8, GPT-5.5, or Gemini 3.1 Pro when you truly need their extra capability.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/ai-pricing-calculator/" title="AI Pricing Calculator - Free Online Tool">Try AI Pricing Calculator on ToolboxKit.io</a>