DEV Community

2x lazymac
2x lazymac

Posted on

I Compared Every AI Model's Pricing — Here's a Cheat Sheet

I went through every major AI model's pricing page so you do not have to. Here is the definitive cheat sheet for 2026 — updated monthly.

The Cheat Sheet

OpenAI

Model Input ($/1M) Output ($/1M) Context Best For
GPT-4 Turbo $10.00 $30.00 128K Complex reasoning
GPT-4o $2.50 $10.00 128K General purpose
GPT-4o mini $0.15 $0.60 128K High volume
o1 $15.00 $60.00 200K Math/science

Anthropic

Model Input ($/1M) Output ($/1M) Context Best For
Claude Opus 4 $15.00 $75.00 200K Complex analysis
Claude Sonnet 4 $3.00 $15.00 200K Best value
Claude Haiku 3.5 $0.25 $1.25 200K Speed + cost

Google

Model Input ($/1M) Output ($/1M) Context Best For
Gemini 1.5 Pro $3.50 $10.50 2M Long context
Gemini 1.5 Flash $0.35 $1.05 1M Budget tasks
Gemini 2.0 Flash $0.10 $0.40 1M Ultra cheap

Quick Cost Calculator

# Calculate cost for any model instantly
curl "https://api.lazy-mac.com/ai-spend/calculate?model=gpt-4o&input_tokens=10000&output_tokens=2000"
Enter fullscreen mode Exit fullscreen mode
import requests

models = ["gpt-4o", "claude-3-sonnet", "gemini-1.5-pro"]
tokens = {"input_tokens": 10000, "output_tokens": 2000}

for model in models:
    resp = requests.get("https://api.lazy-mac.com/ai-spend/calculate",
                       params={"model": model, **tokens})
    cost = resp.json()
    print(f"{model}: ${cost['total_cost']:.4f}")
Enter fullscreen mode Exit fullscreen mode

Cost Per Task (Realistic Estimates)

Task Tokens (in/out) GPT-4o Claude Sonnet Gemini Flash
Chat response 500/200 $0.003 $0.004 $0.0004
Doc summary 5K/1K $0.022 $0.030 $0.003
Code review 10K/2K $0.045 $0.060 $0.006
Long analysis 50K/5K $0.175 $0.225 $0.023

Hidden Costs to Watch

  1. Retries — Failed requests still count. A 10% retry rate adds 10% to your bill.
  2. System prompts — That 2000-token system prompt gets sent with every request.
  3. Streaming overhead — Some providers charge slightly more for streamed responses.
  4. Batch vs real-time — OpenAI's batch API is 50% cheaper but has a 24h SLA.

Automate Price Monitoring

// Node.js: check for price changes
const checkPricing = async () => {
  const resp = await fetch('https://api.lazy-mac.com/ai-spend/pricing');
  const pricing = await resp.json();

  // Compare with your stored baseline
  for (const model of pricing.models) {
    console.log(`${model.name}: $${model.input_price}/1M in, $${model.output_price}/1M out`);
  }
};
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

  • Cheapest: Gemini 2.0 Flash ($0.10/1M input)
  • Best value: GPT-4o or Claude Sonnet (quality/price sweet spot)
  • Most capable: Claude Opus 4 or o1 (for tasks that justify the cost)

Bookmark the AI Spend API for live pricing data on 50+ models.

Get the API on Gumroad | Live pricing endpoint

Top comments (0)