AI API Pricing Calculator
Estimate costs across Google Gemini, OpenAI, xAI Grok & Anthropic Claude. Supports text, images, audio & video.
⚙️ Configure Your Workload
📊 Cost Estimate
🔢 Token Breakdown
📏 Context Window Usage
⚡ All Models Compared (Sorted by Cost)
| Provider | Model | Total Tokens | Per Request | Daily | Monthly | + Caching | + Batch |
|---|
AI API Pricing Per Million Tokens — June 2026 Quick Reference
Choosing the right AI model depends on your workload and budget. Below is a complete, static reference of current per-million-token pricing across the four major API providers as of June 2026. Use the interactive calculator above to estimate monthly costs for your exact request volumes, or refer to this table for a quick side-by-side comparison.
| Provider | Model | Input / 1M Tokens | Output / 1M Tokens | Context Window |
|---|---|---|---|---|
| Gemini 2.5 Flash-Lite | $0.10 | $0.40 | 1M | |
| OpenAI | GPT-4.1 Nano | $0.10 | $0.40 | 1M |
| xAI | Grok 4.1 Fast | $0.20 | $0.50 | 2M |
| Gemini 3.1 Flash-Lite | $0.25 | $1.50 | 1M | |
| Gemini 3 Flash | $0.50 | $3.00 | 1M | |
| Anthropic | Claude Haiku 4.5 | $1.00 | $5.00 | 200K |
| xAI | Grok 4.3 | $1.25 | $2.50 | 1M |
| Gemini 3.5 Flash | $1.50 | $9.00 | 1M | |
| OpenAI | GPT-4.1 | $2.00 | $8.00 | 1M |
| Gemini 3.1 Pro | $2.00 | $12.00 | 1M | |
| Anthropic | Claude Sonnet 4.6 | $3.00 | $15.00 | 1M |
| OpenAI | GPT-5.5 Pro | $5.00 | $30.00 | 1M |
| Anthropic | Claude Opus 4.7 | $5.00 | $25.00 | 1M |
Prices sourced from official provider documentation. Last verified June 2026. Use the calculator above for real-time cost estimates including caching and batch discounts.
How to Use This AI API Pricing Calculator
This free tool is designed for developers, tech leads, and product managers who need to estimate AI API costs before committing to a provider. Here's how to get the most accurate results:
- Select a provider tab (Google Gemini, OpenAI, xAI Grok, or Anthropic Claude) and choose a specific model from the dropdown.
- Enter your text workload — estimate input words (your prompt) and output words (the model's response). A typical chatbot uses 500 input / 200 output words.
- Add multimodal inputs if applicable — images, audio minutes, or video minutes. The calculator automatically converts these to tokens using each provider's official tokenization rates (e.g., Gemini uses 258 tokens per 768×768px image tile).
- Set your daily request volume — how many API calls you expect per day. The calculator then projects daily, monthly, and yearly costs.
- Toggle cost optimizations — enable Prompt Caching (up to 90% savings on repeated input) and/or Batch API (50% savings with 24-hour turnaround) to see discounted pricing.
- Click "Compare All Models" to see a sorted comparison table of every model's cost for your exact workload — instantly identifying the cheapest option.
Which AI API Model Is the Cheapest in June 2026?
For pure text workloads, Gemini 2.5 Flash-Lite and GPT-4.1 Nano are tied at $0.10 per million input tokens — making them the absolute cheapest production-grade AI models available from any major provider. For developers needing a larger context window, Grok 4.1 Fast offers an industry-leading 2 million token context window at just $0.20/1M input.
For multimodal workloads involving images, audio, or video, Google Gemini models are typically the most cost-effective because they process all modalities as tokens within the same API call — no separate endpoint pricing.
The biggest cost savings come from combining Prompt Caching (saving up to 90% on repeated input context) with the Batch API (50% discount for non-urgent workloads). Together, these optimizations can reduce your AI API bill by up to 95%. Use the calculator above to see the exact impact on your projected costs.
Detailed Pricing Guides by Provider
For in-depth breakdowns of each provider's pricing — including real-world cost examples, hidden charges, long-context surcharges, and optimization strategies — explore our comprehensive guides:
- 📘 Google Gemini API Pricing June 2026 — 18 models including Gemini 3.5 Flash, 3.1 Pro, Flash-Lite, and native audio/video tokens
- 📗 OpenAI API Pricing June 2026 — GPT-5.5 Pro, GPT-4.1, o3 reasoning models, DALL·E image generation, and web search tool costs
- 📙 xAI Grok API Pricing June 2026 — Grok 4.3, 4.20, and 4.1 Fast with free $175/mo credits and 2M token context windows
- 📊 AI Model Pricing Comparison 2026 — Side-by-side comparison of all providers sorted by cost and capability tier
- 🎵 Google Gemini TTS & Speech API Pricing — Text-to-speech, Live API, and audio transcription costs
- 🖼️ Google Imagen 4 Image Generation Pricing — Nano Banana and Imagen 4 per-image generation costs
- 💰 How to Cut Your AI API Bill by 90% — Prompt caching, batch API, and cost optimization strategies
Frequently Asked Questions
Costs vary significantly by provider and model. Budget models like Gemini 2.5 Flash-Lite cost $0.10/1M input tokens, while flagship models like GPT-5.5 Pro cost $5.00/1M input tokens. Use our calculator above to compare exact costs for your specific use case.
Token consumption varies by provider. Google Gemini uses 258 tokens per image tile (768×768px). OpenAI charges 85 tokens for low-detail images and 765+ tokens for high-detail. Anthropic Claude estimates roughly (width×height)/750 tokens per image.
Google Gemini processes audio at 32 tokens per second and video at 263 tokens per second. Most other providers (OpenAI, Claude, Grok) do not natively support audio/video input through their standard text APIs — they use separate endpoints with per-minute pricing.
For high-volume simple tasks, Gemini 2.5 Flash-Lite ($0.10/1M input) and GPT-4.1 Nano ($0.10/1M input) are the cheapest options. Grok 4.1 Fast at $0.20/1M input is also very competitive with a massive 2M token context window.
Use Prompt Caching to save up to 90% on repeated input context, and the Batch API (available on most providers) to save 50% on non-urgent workloads. Combining both strategies can reduce costs by up to 95%.
For coding, GPT-4.1 and Gemini 3.1 Pro offer the best balance of capability and cost. For maximum reasoning, o3-Pro ($20/$80 per 1M tokens) and Claude Opus 4.7 ($5/$25) are top choices, though significantly more expensive.