Specialized LLM API Pricing & Prompt Caching Calculators
Calculate OpenAI GPT-5, GPT-4o, GPT-4o mini, and o3-mini API token costs, including 50%–75% Prompt Caching and Batch API discounts.
Calculate Anthropic Claude 4 Sonnet, Claude 4 Opus, and Claude 3.5 Haiku token counts and monthly API costs with 90% prompt caching discounts.
Calculate Google Gemini 2.5 Pro and Gemini 2.5 Flash API costs for long-context RAG, codebase analysis, and high-throughput SaaS apps.
Calculate exact dollar savings from LLM prompt caching and 50% Batch API discounts across OpenAI, Anthropic Claude, Google Gemini, and DeepSeek.
Calculate monthly LLM API costs for AI SaaS startups and RAG pipelines based on Daily Active Users (DAU), requests/day, and token volume.
2026 Frontier LLM API Pricing & Context Window Comparison Table ($ / 1M Tokens)
| Model | Provider | Input ($/1M) | Cached Input ($/1M) | Output ($/1M) | Context Window |
|---|---|---|---|---|---|
| Anthropic Claude 4 Sonnet / 3.7 Sonnet | Anthropic | $3.00 | $0.300 | $15.00 | 200K |
| OpenAI GPT-5 / GPT-4.1 Flagship | OpenAI | $2.00 | $0.500 | $8.00 | 1,000K |
| OpenAI GPT-4o Multimodal | OpenAI | $2.50 | $1.250 | $10.00 | 128K |
| OpenAI GPT-4o mini (High-Speed) | OpenAI | $0.15 | $0.075 | $0.60 | 128K |
| OpenAI o3-mini / o4-mini (Reasoning) | OpenAI | $1.10 | $0.275 | $4.40 | 200K |
| Anthropic Claude 4 Opus | Anthropic | $15.00 | $1.500 | $75.00 | 200K |
| Anthropic Claude 3.5 Haiku | Anthropic | $0.80 | $0.080 | $4.00 | 200K |
| Google Gemini 2.5 Pro (2M Context) | $1.25 | $0.310 | $10.00 | 2,000K | |
| Google Gemini 2.5 Flash (1M Context) | $0.15 | $0.037 | $0.60 | 1,000K | |
| DeepSeek R1 / V3 Reasoning API | DeepSeek | $0.27 | $0.070 | $1.10 | 128K |
| Meta Llama 4 70B / 405B (Groq / Together) | Meta / Cloud | $0.59 | $0.200 | $0.79 | 128K |
Frequently Asked Questions
How does an LLM tokenizer split text, JSON, and code into BPE tokens? ▾
Modern Large Language Models (OpenAI o200k_base, Anthropic Claude, Google Gemini) use Byte-Pair Encoding (BPE). In English prose, 1 token averages ~4 characters (~0.75 words). However, in JSON, Python, and TypeScript code, punctuation symbols ({}[](),:;), numbers, and camelCase identifiers split into additional subword tokens—which our lexer-based BPE estimator models automatically.
How much does Prompt Caching reduce monthly LLM API bills? ▾
Prompt Caching discounts repeated system prompts, tool schemas, and RAG documents by 50% to 75% on OpenAI and Google Gemini, and by 90% on Anthropic Claude ($0.30/1M vs. $3.00/1M on Claude Sonnet).
Are internal "Thinking / Reasoning" tokens billed as input or output tokens? ▾
Reasoning models (such as OpenAI o3-mini / o4-mini, Claude Extended Thinking, and DeepSeek R1) bill internal chain-of-thought reasoning tokens at the model’s output token rate.