← Back to blog
15 min read

AI Model Pricing Guide 2026: Claude, GPT-4.1, Grok, Gemini, DeepSeek Compared

comparisontrendsagentic-ai
ai-model-pricing-guide-2026.md

AI Model Pricing Guide 2026: Claude, GPT-4.1, Grok, Gemini, DeepSeek Compared

Every API call costs money. Every re-explained context costs more. Every session that starts from zero because your agent forgot everything? That is the most expensive line item on your AI bill — and it does not show up on any invoice.

This guide covers every major model's pricing as of April 2026. API costs, subscription tiers, context windows, and the one cost nobody talks about: the re-context tax.

```

┌─────────────────────────────────────────────────────────┐

│ THE AI PRICING LANDSCAPE — APRIL 2026 │

│ │

│ Provider Cheapest Flagship Context │

│ ───────── ────────────── ──────────── ─────── │

│ Anthropic $0.80/1M (H) $15/1M (O) 200K │

│ OpenAI $0.10/1M (N) $10/1M (o3) 1M │

│ Google $0.15/1M (F) $1.25/1M (P) 1M │

│ xAI $0.30/1M (m) $3/1M (G3) 131K │

│ DeepSeek $0.07/1M (c) $0.55/1M (R1) 128K │

│ │

│ H=Haiku O=Opus N=Nano F=Flash P=Pro │

│ m=Mini G3=Grok3 c=cached R1=R1 │

└─────────────────────────────────────────────────────────┘

```

---

Anthropic — Claude

Anthropic offers three API tiers plus Claude Code subscriptions for developers.

Claude Code (Subscription)

```

┌───────────────────────────────────────────────┐

│ CLAUDE CODE PRICING │

│ │

│ Plan Price Usage │

│ ────────── ───── ────────────────── │

│ Pro $20/mo Standard quota │

│ Max 5x $100/mo 5x usage of Pro │

│ Max 20x $200/mo 20x usage of Pro │

│ │

│ Models: Opus 4.6 + Sonnet 4.6 │

│ Context: 200K tokens │

└───────────────────────────────────────────────┘

```

Claude Code uses Opus 4.6 for complex reasoning and Sonnet 4.6 for faster tasks. The Pro tier at $20/month is the entry point. Max tiers multiply the usage allowance — same models, more throughput.

Claude API Pricing

```

┌─────────────────────────────────────────────────┐

│ CLAUDE API — PRICE PER 1M TOKENS │

│ │

│ Model Input Output Context │

│ ──────────────── ─────── ────── ──────── │

│ Haiku 4.5 $0.80 $4.00 200K │

│ Sonnet 4.6 $3.00 $15.00 200K │

│ Opus 4.6 $15.00 $75.00 200K │

│ │

│ Prompt caching: 90% discount on cached tokens │

│ Batch API: 50% discount, 24h turnaround │

└─────────────────────────────────────────────────┘

```

Haiku 4.5 is the workhorse for high-volume, low-complexity tasks — classification, extraction, simple Q&A. At $0.80 input / $4.00 output per million tokens, it is the cheapest Claude model.

Sonnet 4.6 hits the sweet spot for most coding and analysis tasks. $3/$15 per million tokens with strong reasoning capabilities.

Opus 4.6 is the flagship. $15/$75 per million tokens. Best-in-class for complex reasoning, long-horizon planning, and agentic workflows. Claude Code defaults to Opus 4.6 for its primary model.

Key feature: Prompt caching gives a 90% discount on repeated prefixes. If you send the same system prompt with every request, only the first call pays full price. This matters enormously for agents that use structured system prompts.

---

OpenAI — GPT-4.1, o3, o4-mini

OpenAI has the broadest model lineup, from the ultra-cheap Nano to the reasoning-focused o-series.

ChatGPT Subscriptions

```

┌───────────────────────────────────────────────┐

│ CHATGPT SUBSCRIPTIONS │

│ │

│ Plan Price Access │

│ ────────── ───── ────────────────── │

│ Plus $20/mo GPT-4.1, o4-mini │

│ Pro $200/mo Unlimited o3, o4 │

│ │

│ Note: Assistants API deprecated Aug 2026 │

└───────────────────────────────────────────────┘

```

OpenAI API Pricing

```

┌──────────────────────────────────────────────────┐

│ OPENAI API — PRICE PER 1M TOKENS │

│ │

│ Model Input Output Context │

│ ────────────── ─────── ─────── ──────── │

│ GPT-4.1 $2.00 $8.00 1M │

│ GPT-4.1-mini $0.40 $1.60 1M │

│ GPT-4.1-nano $0.10 $0.40 1M │

│ o3 $10.00 $40.00 200K │

│ o4-mini $1.10 $4.40 200K │

│ │

│ Cached input: 50% discount │

│ Batch API: 50% discount │

└──────────────────────────────────────────────────┘

```

GPT-4.1 is the new general-purpose flagship. $2/$8 per million tokens with a 1M token context window — the largest in the GPT lineup. Strong at coding, instruction following, and long-document analysis.

GPT-4.1-mini ($0.40/$1.60) and GPT-4.1-nano ($0.10/$0.40) are the budget options. Nano is remarkably cheap — 15x less than Haiku 4.5 on input — but trades away reasoning depth. Good for classification, routing, and simple extraction.

o3 ($10/$40) is OpenAI's strongest reasoning model. It excels at math, science, and multi-step planning. Expensive, but the reasoning quality justifies the cost for complex tasks.

o4-mini ($1.10/$4.40) brings reasoning capabilities at a fraction of o3's price. The go-to for coding agents that need chain-of-thought without the o3 price tag.

Important: The Assistants API — threads, runs, file search — is deprecated as of August 2026. If you built memory on top of Assistants, you need a migration plan. See our migration guide.

---

Google — Gemini 2.5

Google's Gemini 2.5 generation offers the best price-per-token for premium models, with a 1M token context window across the lineup.

Gemini API Pricing

```

┌───────────────────────────────────────────────────────┐

│ GEMINI API — PRICE PER 1M TOKENS │

│ │

│ Model Input Output Context │

│ ──────────────── ──────── ──────── ────────── │

│ 2.5 Pro (<200K) $1.25 $10.00 1M │

│ 2.5 Pro (>200K) $2.50 $15.00 1M │

│ 2.5 Flash (<200K) $0.15 $0.60 1M │

│ 2.5 Flash (>200K) $0.30 $1.80 1M │

│ │

│ Note: Price doubles beyond 200K context │

└───────────────────────────────────────────────────────┘

```

Gemini 2.5 Pro at $1.25/$10 (under 200K) is remarkably competitive — cheaper than Claude Sonnet on input and comparable on output. The catch: prices double when you exceed 200K tokens of context. That 1M window is available but expensive to fill.

Gemini 2.5 Flash at $0.15/$0.60 is the budget champion for contexts under 200K. Faster and cheaper than GPT-4.1-nano for many tasks, with substantially better reasoning.

The tiered pricing model is unique to Gemini. If your workloads consistently stay under 200K tokens, Gemini offers some of the best value in the market. If you regularly need 500K+ context, the doubled pricing makes it less compelling.

---

xAI — Grok 3

xAI's Grok models are priced in the mid-range, with a focus on real-time knowledge and conversational quality.

Grok API Pricing

```

┌──────────────────────────────────────────────────┐

│ GROK API — PRICE PER 1M TOKENS │

│ │

│ Model Input Output Context │

│ ────────────── ─────── ─────── ──────── │

│ Grok 3 $3.00 $15.00 131K │

│ Grok 3 Mini $0.30 $0.50 131K │

│ │

│ Live search: included at no extra cost │

└──────────────────────────────────────────────────┘

```

Grok 3 at $3/$15 matches Claude Sonnet's pricing exactly but with a smaller context window (131K vs 200K). Its strength is real-time knowledge — Grok has access to live X (Twitter) data and web search built in.

Grok 3 Mini at $0.30/$0.50 has an unusually low output price. At $0.50 per million output tokens, it is cheaper on output than every other model in this guide except GPT-4.1-nano. Good for tasks that generate long outputs on a budget.

The context limitation matters. At 131K tokens, Grok cannot handle the ultra-long documents that GPT-4.1 (1M) or Gemini (1M) can process. For long-context workloads, look elsewhere.

---

DeepSeek

DeepSeek offers the lowest prices in the market, period. The trade-off is availability and rate limits.

DeepSeek API Pricing

```

┌──────────────────────────────────────────────────────┐

│ DEEPSEEK API — PRICE PER 1M TOKENS │

│ │

│ Model Input Cached Output Context │

│ ────────── ────── ────── ────── ──────── │

│ DeepSeek V3 $0.27 $0.07 $1.10 64K │

│ DeepSeek R1 $0.55 $0.14 $2.19 128K │

│ │

│ Cache hit discount: ~75% on input │

└──────────────────────────────────────────────────────┘

```

DeepSeek V3 at $0.27/$1.10 is the cheapest capable model for general tasks. With cache hits at $0.07 per million tokens, repeated workloads cost almost nothing. The 64K context window is the smallest in this comparison, which limits use cases.

DeepSeek R1 at $0.55/$2.19 adds reasoning capabilities. It is competitive with o4-mini at a fraction of the price, though with a smaller context window (128K vs 200K).

The trade-offs: Smaller context windows (64K-128K), occasional availability issues, and rate limits during peak usage. DeepSeek is best for cost-sensitive batch workloads where latency is not critical.

---

The Complete Comparison

Every model, side by side. Prices per 1M tokens.

```

┌──────────────────────────────────────────────────────────────────┐

│ MODEL COMPARISON — ALL PRICES PER 1M TOKENS │

├──────────────────┬─────────┬──────────┬─────────┬───────────────┤

│ Model │ Input │ Output │ Context │ Best For │

├──────────────────┼─────────┼──────────┼─────────┼───────────────┤

│ Claude Opus 4.6 │ $15.00 │ $75.00 │ 200K │ Deep reason │

│ o3 │ $10.00 │ $40.00 │ 200K │ Math/science │

│ Claude Son 4.6 │ $3.00 │ $15.00 │ 200K │ Code/general │

│ Grok 3 │ $3.00 │ $15.00 │ 131K │ Real-time │

│ GPT-4.1 │ $2.00 │ $8.00 │ 1M │ Long context │

│ Gemini 2.5 Pro │ $1.25 │ $10.00 │ 1M │ Value/quality │

│ o4-mini │ $1.10 │ $4.40 │ 200K │ Code reason │

│ Claude Haiku │ $0.80 │ $4.00 │ 200K │ High volume │

│ DeepSeek R1 │ $0.55 │ $2.19 │ 128K │ Budget reason │

│ GPT-4.1-mini │ $0.40 │ $1.60 │ 1M │ Budget code │

│ Grok 3 Mini │ $0.30 │ $0.50 │ 131K │ Long output │

│ DeepSeek V3 │ $0.27 │ $1.10 │ 64K │ Cheapest │

│ Gemini 2.5 Fl │ $0.15 │ $0.60 │ 1M │ Fast+cheap │

│ GPT-4.1-nano │ $0.10 │ $0.40 │ 1M │ Classification│

└──────────────────┴─────────┴──────────┴─────────┴───────────────┘

```

Subscription Comparison

```

┌──────────────────────────────────────────────────────────┐

│ SUBSCRIPTION TIERS — MONTHLY COST │

├──────────────────────┬────────┬──────────────────────────┤

│ Plan │ Price │ What You Get │

├──────────────────────┼────────┼──────────────────────────┤

│ Claude Code Pro │ $20 │ Opus 4.6 + Sonnet 4.6 │

│ ChatGPT Plus │ $20 │ GPT-4.1, o4-mini │

│ Claude Code Max 5x │ $100 │ 5x Pro usage │

│ ChatGPT Pro │ $200 │ Unlimited o3, o4 │

│ Claude Code Max 20x │ $200 │ 20x Pro usage │

└──────────────────────┴────────┴──────────────────────────┘

```

---

The Hidden Cost: The Re-Context Tax

Every pricing table above is missing the most expensive line item.

Context windows reset every session. Your agent forgets everything. Next session, you explain the same codebase, the same conventions, the same preferences. You pay for those tokens again. And again. And again.

```

┌─────────────────────────────────────────────────────────┐

│ THE RE-CONTEXT TAX │

│ │

│ Session 1: [system prompt] + [context] + [task] │

│ ───────────────────────────────────── │

│ 2,000 + 8,000 + 1,000 = 11,000 tokens │

│ │

│ Session 2: [system prompt] + [context] + [task] │

│ Same 8,000 context tokens re-sent ←────┐ │

│ │ │

│ Session 3: [system prompt] + [context] + [task] │ │

│ Same 8,000 context tokens AGAIN ←───────┘ │

│ │

│ After 30 sessions: 240,000 wasted tokens │

│ After 365 days: 2,920,000 wasted tokens │

│ │

│ At Sonnet pricing ($3/1M input): │

│ → $8.76/year per agent, per context block │

│ │

│ At Opus pricing ($15/1M input): │

│ → $43.80/year per agent, per context block │

│ │

│ Scale to 100 agents with 10 context blocks each: │

│ → $43,800/year in PURE WASTE (Opus) │

└─────────────────────────────────────────────────────────┘

```

This is the re-context tax. Every team running AI agents at scale pays it. Most do not even realize it because it is invisible — hidden inside token counts that look like normal usage.

The math gets worse. The 8,000 tokens above is conservative. Real-world coding agents routinely send 20,000-50,000 tokens of context per session — file contents, architecture notes, coding conventions, deployment configs. A team of 10 engineers, each with an agent doing 5 sessions per day, burns through millions of context tokens weekly.

The Fix: Persistent Memory

```

┌─────────────────────────────────────────────────────────┐

│ WITHOUT MEMORY WITH MEMORY │

│ │

│ Session 1: Session 1: │

│ [prompt + context + task] [prompt + context + task] │

│ 11,000 tokens 11,000 tokens │

│ → shodh stores context │

│ Session 2: │

│ [prompt + context + task] Session 2: │

│ 11,000 tokens (repeat!) [prompt + task] │

│ 3,000 tokens │

│ Session 3: → shodh recalls context │

│ [prompt + context + task] │

│ 11,000 tokens (repeat!) Session 3: │

│ [prompt + task] │

│ Total: 33,000 tokens 3,000 tokens │

│ │

│ 3 sessions: Total: 17,000 tokens │

│ 33,000 vs 17,000 = 48% savings │

│ │

│ 30 sessions: │

│ 330,000 vs 41,000 = 88% savings │

└─────────────────────────────────────────────────────────┘

```

With persistent memory, context is stored once and recalled on demand. The agent sends only the task — shodh-memory provides the context from local storage. No API call. No tokens. Sub-millisecond retrieval.

---

Cost Optimization Strategies

Here are five strategies that compound to dramatically reduce your AI spend.

1. Use Cheaper Models + Persistent Memory

Instead of paying for Opus ($15/$75) to re-understand your codebase every session, use Sonnet ($3/$15) with shodh-memory providing persistent context. The agent already knows your codebase — it does not need Opus-level reasoning to recall it.

```

┌──────────────────────────────────────────────────┐

│ COST COMPARISON: OPUS vs SONNET + MEMORY │

│ │

│ Approach Input/1M Context Monthly* │

│ ────────────── ──────── ─────── ──────── │

│ Opus, no memory $15.00 re-sent $450.00 │

│ Sonnet + shodh $3.00 recalled $54.00 │

│ │

│ Savings: 88% ($396/month per agent) │

│ * Assumes 10 sessions/day, 30K context tokens │

└──────────────────────────────────────────────────┘

```

2. Cache Aggressively

Anthropic's prompt caching gives 90% off cached prefixes. OpenAI gives 50%. Structure your prompts with static prefixes (system prompt, tool definitions) to maximize cache hits.

3. Route by Complexity

Not every task needs a flagship model. Route simple tasks to Nano ($0.10/$0.40) or Flash ($0.15/$0.60), and reserve Opus/o3 for tasks that actually require deep reasoning.

```

┌────────────────────────────────────────────────┐

│ ROUTING STRATEGY │

│ │

│ Task Type → Model → Cost │

│ ────────────── ────────── ────── │

│ Classification → GPT-4.1-nano → $0.10 │

│ Summarization → Gemini Flash → $0.15 │

│ Code generation → Sonnet 4.6 → $3.00 │

│ Architecture → Opus 4.6 → $15.00 │

│ Math proofs → o3 → $10.00 │

│ │

│ Blended rate: ~$1.50/1M vs $15/1M flat │

└────────────────────────────────────────────────┘

```

4. Batch Non-Urgent Work

Both Anthropic and OpenAI offer 50% discounts on batch API requests. If your workload can tolerate a 24-hour turnaround, batch it.

5. Eliminate the Re-Context Tax Entirely

This is the single highest-impact optimization. A persistent memory system stores your agent's learned context and recalls it automatically. No tokens wasted on re-explanation. No degradation over sessions. Context compounds instead of resetting.

---

shodh-memory: Eliminating the Invisible Cost

shodh-memory is an open-source cognitive memory system that runs 100% offline. It gives your AI agents persistent memory that survives across sessions — so you stop paying the re-context tax.

```

┌──────────────────────────────────────────────────┐

│ HOW IT WORKS │

│ │

│ Agent ──→ shodh-memory ──→ Agent │

│ │ │ │ │

│ │ ┌────┴─────┐ │ │

│ │ │ RocksDB │ Context recalled │

│ │ │ Vectors │ in <1ms │

│ │ │ Graph │ │ │

│ │ └──────────┘ │ │

│ │ │ │

│ └── stores context uses context ──┘ │

│ once automatically │

│ │

│ Cost: $0.00 — runs locally, no API calls │

│ Latency: <1ms write, 34-58ms semantic search │

│ Size: ~30MB binary, no Docker required │

└──────────────────────────────────────────────────┘

```

What you get:

Persistent memory across all sessions — context stored once, recalled forever
Cognitive features: Hebbian learning, power-law decay, knowledge graphs
Works with Claude Code, Cursor, Windsurf, any MCP client
45 MCP tools, 60+ REST endpoints, Python bindings
100% offline — no cloud, no API keys, no data leaving your machine
Apache 2.0 licensed, 1089 tests, research paper
```bash

Install in 10 seconds

npx @shodh/memory-mcp@latest

```

The cheapest token is the one you never send. Stop paying the re-context tax.

GitHub

$ subscribe

Get updates on releases, features, and AI memory research.