Techsy
Contact
Get Started

OpenAI, Claude & Gemini API cost calculator

Compare monthly costs across providers with caching and batch savings.

API costs for GPT, Claude, and Gemini range from $0.15 to $75 per million input tokens, with output tokens typically 3–5× more expensive. At 10 million tokens/month, GPT-4o runs about $775, Claude Sonnet 4 runs about $1,140, and Gemini 2.5 Pro runs about $825. Prompt caching cuts costs 10× on cached tokens; Batch API cuts costs 50% for non-realtime work. This calculator lets you model exact usage across all three providers.

Home/Resources/Tools/OpenAI, Claude & Gemini API cost calculator
↓ Open the calculator

Your inputs

05 fields

Estimated monthly cost

● High confidence

$47 – $72

Median estimate: $55

Cost breakdown

Input tokens (10M × $2.50/M)$25
Output tokens (3M × $10.00/M)$30

Email + phone required. 30-min review call with our team.

See how a United States team would price your full scope →

Who should use this tool

Founders scoping a openai api project before talking to vendors. CTOs and engineering leaders building an annual budget for new product work. Product managers translating a one-line idea into a defensible range for finance. Procurement teams sanity-checking quotes from agencies and contractors.

How we calculate this

Prices based on publicly posted rates from OpenAI, Anthropic, and Google as of 2026. Prompt caching applies to cached input tokens only (typically the system prompt + stable context). Batch API applies to both input and output tokens for non-realtime work with 24-hour SLA.

Data sources

  • OpenAI public API pricing
  • OpenAI Batch API documentation
  • Anthropic public API pricing
  • Anthropic prompt caching documentation
  • Anthropic Message Batches API
  • Google AI / Gemini API pricing
  • OpenAI prompt caching documentation

Factors that move the number

Model tier selection

Frontier models like GPT-4.5, Claude Opus 4, and Gemini 2.5 Pro are 5 to 10 times more expensive per token than their mid-tier siblings. Use frontier only for hard reasoning tasks where mid-tier genuinely fails: complex multi-step logic, math, ambiguous code generation, or tasks requiring deep world knowledge. Route everything else to Claude Sonnet 4, GPT-4o, or Gemini Flash. The cost gap is large enough that smart routing typically cuts spend by 60 to 80% on mixed workloads.

Prompt caching

Anthropic caches input tokens for 5 minutes free or 1 hour with a 25% surcharge, cutting cached token costs by roughly 90%. OpenAI caches automatically for 5 to 10 minutes on certain endpoints with no configuration required. Caching works best when your system prompt is over 2K tokens and stable across requests, which describes most production chatbots and RAG systems. The savings are largest on workloads with long stable context and many requests per minute.

Batch API

Both OpenAI and Anthropic offer batch endpoints at exactly 50% off standard pricing in exchange for a 24-hour SLA. Batch is ideal for classification, embedding generation, summarization, evaluation runs, and any background processing. The integration is trivial: same model, same prompt, different endpoint, plus a queue to wait for results. Most teams overlook batch and pay full price for workloads that have no real-time requirement, which is one of the easiest preventable AI costs.

Output tokens

Output tokens cost 3 to 5 times more than input tokens across all providers, and most responses do not need the 4K-token output buffer the API allows by default. If you are extracting a yes-or-no answer, cap output at 10 tokens. If you are generating a short summary, cap it at 200. The model often wants to explain its reasoning even when you did not ask, and you are paying for those explanations. Tightening max_tokens often cuts output costs 30 to 50% with no quality impact.

Context window does not equal price

All major providers charge per token consumed, not per context window size. Using a 200K context window for a 5K-token prompt costs exactly the same as using a 5K context window for a 5K-token prompt. The implication is that long-context models are not "more expensive to use" unless you actually fill the context. Pick the model based on capability and price per token, not on which context window is largest.

How to reduce cost

Enable prompt caching as the first optimization, before anything else. For Anthropic, mark your stable system prompt with cache_control headers and cached tokens drop to roughly 10% of standard input price. For OpenAI, caching happens automatically on certain endpoints when your prompt prefix is identical across requests. The win is largest on workloads with long stable context and many requests: chatbots with detailed personas, RAG systems with repeated retrieval context, and any agent loop that re-sends a long instruction set. Most teams forget to enable caching and overpay 5 to 10 times.

Move every non-real-time workload to the Batch API. Both Anthropic and OpenAI offer batch endpoints at exactly 50% of standard pricing in exchange for a 24-hour response SLA. Classification jobs, content moderation, embedding generation, summarization pipelines, and evaluation runs are all good candidates. The integration work is trivial because the prompt and model are unchanged. Teams routinely run their entire content tagging pipeline at standard pricing when batch would cut the bill in half with zero quality difference.

Route requests by difficulty. Simple queries (greetings, formatting, basic lookups) belong on GPT-4o mini, Claude Haiku, or Gemini Flash at $0.15 to $0.80 per million input tokens. Hard reasoning belongs on Claude Opus, GPT-4.5, or Gemini Pro at $1.25 to $75 per million. A small classifier in front of your model router typically cuts costs 60 to 80% on mixed workloads. Sending everything to a frontier model is the most common AI cost mistake we see in production.

Cap max_tokens aggressively. Output tokens cost 3 to 5 times more than input tokens, and the default 4K output buffer is far larger than most responses need. Cap yes-or-no answers at 10 tokens, short summaries at 200, structured JSON at whatever your schema requires plus a small buffer. The model sometimes wants to elaborate even when you did not ask, and you pay for those elaborations. Tightening max_tokens is a 30 to 50% output cost reduction in most cases.

Strip retrieved context to only what is needed per query. RAG systems often retrieve 10 to 20 chunks and stuff all of them into the prompt for safety. The result is paying for thousands of irrelevant tokens per request. Adding a reranker that filters down to the top 3 to 5 most relevant chunks typically cuts input token usage by 50 to 70% with no quality loss, often with quality improvement because the model is not distracted by irrelevant context.

Log every request with token counts, model, and cached versus uncached status. You cannot optimize what you cannot see, and AI costs can change shape overnight when a new feature ships or a prompt gets tweaked. Set daily spend alerts. Build a dashboard that breaks down spend by feature, model, and endpoint. Most production cost overruns we encounter happen because a usage pattern shifted two weeks before anyone looked at the bill.

Cost per million tokens (2026 pricing)

ModelInputOutputCached input
GPT-4.5$75.00$150.00$37.50
GPT-4o$2.50$10.00$1.25
GPT-4o mini$0.15$0.60$0.075
Claude Opus 4$15.00$75.00$1.50
Claude Sonnet 4$3.00$15.00$0.30
Claude Haiku 4$0.80$4.00$0.08
Gemini 2.5 Pro$1.25$10.00N/A
Gemini 2.5 Flash$0.075$0.30N/A

FAQ

Questions we get every week

The short answers, written in plain language. If your question isn’t here,

GPT-4o: $2.50 per million input tokens, $10 output. GPT-4o mini: $0.15/M input, $0.60 output. GPT-4.5: $75/M input, $150 output. At 10M tokens per month with a 30/70 input/output split, expect $25–$13K depending on model.

For most workloads: GPT-4o mini, Gemini 2.5 Flash, or Claude Haiku 4; all under $1 per million input tokens. For quality-price balance: Claude Sonnet 4 or Gemini 2.5 Pro.

Anthropic and OpenAI cache large input prompts between requests. Cached tokens cost about 90% less than uncached. Best for chatbots with stable system prompts or RAG with stable context.

Exactly 50% on both input and output tokens. Requires accepting a 24-hour SLA. Good for classification, summarization, embedding, and evaluation. Bad for real-time chat or interactive UX.

At comparable quality tiers, similar cost. Claude Sonnet 4 versus GPT-4o is roughly even. Claude Opus 4 with prompt caching runs about 30% cheaper than GPT-4o on stable-prompt workloads.

(1) Enable prompt caching. (2) Use Batch API where possible. (3) Route simple queries to mini models. (4) Cap max_tokens aggressively. (5) Strip retrieval context to essentials.

Break-even sits around $5K per month in API spend. Below that: keep using APIs. Above: self-hosting Llama 3.1 or Mistral cuts costs 50–70% if you have the infrastructure expertise.

Take a representative 100-request sample. Measure average input and output tokens. Multiply by monthly request volume. Multiply by cost per million tokens. Add 30% safety margin.

Only for hard reasoning where mid-tier models fail. For 80% of production workloads, Sonnet 4, GPT-4o, or Gemini 2.5 Pro work fine at 10× lower cost.

Within ±15% for typical workloads. Real-world variance comes from prompt length variation, output length variation, error and retry loops, and routing logic. Use the calculator as a planning tool, not a final bill.

Similar tools

Other calculators most people open right after this one; pick the one that maps to your next decision.

AI integration cost calculator
AI integration cost calculator

Build cost plus monthly run cost; the full picture.

Open the calculator

Get a precise estimate from our team

Calculators give you a range. A 30-minute call gives you a fixed scope, timeline, and budget. Free consultation, no obligation.

Start the conversation

Hot from the library

Resources

See all
  • The Software Procurement Playbook

    A repeatable framework for buying software without burning six months and a million dollars on the wrong platform.

  • The Architecture Decision Playbook

    A practical framework for picking your stack: when to build vs. buy, monolith vs. microservices, and how to avoid resume-driven design.

  • The Vendor Selection Playbook

    How to pick the right development partner (agency, freelancer, in-house) without overpaying or shipping a half-built product.

Claude Skills

See all
  • New Post

    Full SEO blog pipeline: research, brief, write, validate, image, translate, publish to Sanity. Autonomous from start to finish.

  • Content Refresh

    Audit a stale post, find decay drivers, and ship a SERP-aligned refresh without losing existing rankings.

  • SEO Audit

    Site-wide SEO audit with prioritized fix list: technical, on-page, and EEAT signals.

AI Automations

See all
  • Security Auditor

    Weekly SCA + IaC scan with prioritized fix PRs.

  • Cold Email Writer

    Generates first-touch emails grounded in one specific public detail.

  • Lead Research Agent

    Enrich an email into a profile, score fit, alert in Slack.

Hot from the library

Resources

See all
  • The Software Procurement Playbook

    A repeatable framework for buying software without burning six months and a million dollars on the wrong platform.

  • The Architecture Decision Playbook

    A practical framework for picking your stack: when to build vs. buy, monolith vs. microservices, and how to avoid resume-driven design.

  • The Vendor Selection Playbook

    How to pick the right development partner (agency, freelancer, in-house) without overpaying or shipping a half-built product.

Claude Skills

See all
  • New Post

    Full SEO blog pipeline: research, brief, write, validate, image, translate, publish to Sanity. Autonomous from start to finish.

  • Content Refresh

    Audit a stale post, find decay drivers, and ship a SERP-aligned refresh without losing existing rankings.

  • SEO Audit

    Site-wide SEO audit with prioritized fix list: technical, on-page, and EEAT signals.

AI Automations

See all
  • Security Auditor

    Weekly SCA + IaC scan with prioritized fix PRs.

  • Cold Email Writer

    Generates first-touch emails grounded in one specific public detail.

  • Lead Research Agent

    Enrich an email into a profile, score fit, alert in Slack.

Services

  • Enterprise Solutions
  • Mobile Apps
  • Web Applications

Solutions

  • CRM Systems
  • AI Integration
  • ERP Solutions
  • Voice Agents
  • Process Automation
  • Cybersecurity

Library

  • Resources
  • Blog
  • Portfolio

Community

  • AI Automations
  • Claude Skills

Tools

  • Mobile App Cost Calculator
  • OpenAI / LLM API Cost Calculator
  • MVP Cost Calculator
  • Voice AI Agent Cost Calculator

Company

  • About
  • Partners
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

Services

  • Enterprise Solutions
  • Mobile Apps
  • Web Applications

Solutions

  • CRM Systems
  • AI Integration
  • ERP Solutions
  • Voice Agents
  • Process Automation
  • Cybersecurity

Library

  • Resources
  • Blog
  • Portfolio

Community

  • AI Automations
  • Claude Skills

Tools

  • Mobile App Cost Calculator
  • OpenAI / LLM API Cost Calculator
  • MVP Cost Calculator
  • Voice AI Agent Cost Calculator

Company

  • About
  • Partners
  • Contact
LegalPrivacy PolicyTerms of ServiceCookie Policy
TECHSY
© 2026 Techsy. All rights reserved.