AI Engineering

OpenAI vs Claude vs Gemini API Pricing: Cost Calculator Guide

Compare OpenAI vs Claude vs Gemini API pricing, then turn token rates into monthly cost per user and margin with a worked example and free calculator.

AI Engineering Claude API Pricing OpenAI API Pricing Gemini API Pricing AI API Cost SaaS Pricing
Founder comparing OpenAI, Claude and Gemini API pricing on a laptop
AI Engineering Practical engineering guide

OpenAI, Claude and Gemini all publish their API pricing per million tokens, but that number alone does not tell you what an AI feature will cost each month, or whether your subscription price still leaves a profit. I built a free AI API Cost Calculator to turn token prices into a monthly number before choosing a model.

In this guide I compare current OpenAI vs Claude vs Gemini API pricing, show how to turn those rates into cost per user with a worked example, explain what changes the bill more than the model, and how to check your margin before you launch.

OpenAI vs Claude vs Gemini API pricing at a glance

A token is a small piece of text, roughly three quarters of an English word. Providers charge separately for input tokens (what you send), cached input (repeated text the provider has already processed) and output tokens (what the model writes back). The table shows standard-tier rates in US dollars per 1 million tokens, taken from each provider's official pricing page on 11 November 2026.

ModelInputCached inputOutput
OpenAI GPT-6 Luna$0.10$0.01$0.50
OpenAI GPT-6.1 Sol$2.00$0.10$10.00
OpenAI GPT-6 Astra$10.00$1.00$50.00
Claude Haiku 5.5 (prompts up to 100K tokens)$0.10$0.01$0.50
Claude Sonnet 5.5$2.00$0.10$10.00
Claude Opus 5.5$4.00$0.20$20.00
Gemini 3.5 Flash-Lite$0.30$0.03$2.50
Gemini 3.8 Flash (promo until 31 Dec 2026)$0.75$0.075$3.75
Gemini 4 Carbon (promo until 30 Nov 2026)$2.00$0.10$10.00

Check the OpenAI pricing, Claude pricing and Gemini pricing pages before you commit, because rates move. Four details matter more than the headline numbers:

  • Promotions end. Gemini 3.8 Flash doubles to $1.50 input and $7.50 output on 1 January 2027. Gemini 4 Carbon goes to $4.00 and $20.00 on 1 December 2026.
  • "Cached" works differently. On Claude, writing a prompt to the 5-minute cache costs 1.25 times the base input price, and later reads are cheap. Gemini context caching adds an hourly storage fee. Compare the mechanics, not just the column.
  • Long prompts can cost more. OpenAI charges higher rates above 272K input tokens, Claude Haiku 5.5 above 100K and Gemini 3.1 Pro above 200K. Claude Sonnet 5.5 and Opus 5.5 keep the same rate across their full 1M context.
  • Batch is half price. All three offer roughly 50% off for jobs that can wait, such as nightly summaries.

How to turn API pricing into cost per user

Price per token is the wrong unit for a product decision. What you need is cost per user per month, because that is what your subscription price has to cover. Five numbers get you there:

  1. Input tokens per request. Count everything you send: the system prompt, previous messages, any retrieved documents and the user's message. The system prompt and history are often bigger than the question.
  2. Output tokens per request. Include reasoning or "thinking" tokens. Gemini lists output prices including thinking, and Claude bills thinking as output too.
  3. Requests per user per month. Count API calls, not clicks. An agent that plans, searches and writes can make four or five calls for one user action.
  4. Cached share. The part of the input that repeats exactly, usually the system prompt and fixed instructions.
  5. Rates for the model, from the table above.

The maths is small enough to keep in your codebase next to the feature:

function monthlyApiCost({ users, requestsPerUser, inputTokens, outputTokens, cachedShare, rates }) {
  const requests = users * requestsPerUser;
  const input = requests * inputTokens;
  const cached = input * cachedShare;      // billed at the cached rate
  const uncached = input - cached;         // billed at the full input rate
  const output = requests * outputTokens;  // usually the biggest line
  return (uncached * rates.input + cached * rates.cached + output * rates.output) / 1_000_000;
}

// 1,000 users, 80 requests each, 2,500 tokens in, 500 out, 40% cached
monthlyApiCost({ users: 1000, requestsPerUser: 80, inputTokens: 2500, outputTokens: 500,
  cachedShare: 0.4, rates: { input: 2, cached: 0.1, output: 10 } }); // 648

A worked example: a support assistant

These are the numbers from the calculator's "Support" preset: 1,000 users, 80 requests each per month, 2,500 input tokens and 500 output tokens per request, with 40% of input cached. That is 80,000 requests, 200 million input tokens and 40 million output tokens a month.

ModelMonthly API costPer user
GPT-6 Luna or Claude Haiku 5.5$32.80$0.03
Gemini 3.8 Flash (promo price)$246$0.25
Gemini 3.8 Flash (from January 2027)$492$0.49
GPT-6.1 Sol or Claude Sonnet 5.5$648$0.65
Claude Opus 5.5$1,296$1.30
GPT-6 Astra$3,280$3.28

Three things stand out. Output is only one sixth of the tokens but about 62% of the bill, because output costs five times the input rate. The cheapest tier is about 20 times cheaper than the mid tier, so the first question is whether a small model is good enough for the task. And GPT-6.1 Sol and Claude Sonnet 5.5 cost exactly the same here, so between those two the decision is about answer quality, speed and tooling, not price.

Founder estimating AI API cost per user in a notebook next to a laptop
Five inputs decide the monthly bill: input tokens, output tokens, requests per user, cached share and the model's rates.

What changes the bill more than the model

Switching models is the obvious lever, but in my experience the shape of each request matters as much. These are the levers I check before blaming the price list.

Output length

Since output dominates the bill, asking for shorter answers and setting a sensible maximum output length is often the cheapest saving. A support reply rarely needs 800 tokens.

Conversation history

Chat APIs are stateless, so each turn usually resends the earlier messages. Input grows with every turn, which means the tenth message in a conversation can cost several times the first. Trimming or summarising older turns keeps that growth in check.

Prompt caching

Put stable content first: the system prompt, tool definitions and fixed instructions. In the support example, caching 40% of the input brings Claude Sonnet 5.5 from $800 to $648 a month, a saving of 19%. Anything that changes on every request, such as a timestamp near the top of the prompt, quietly breaks the cache.

Fallbacks, retries and promotions

The assistant on this site uses Gemini 3.8 Flash by default and falls back to an open-weight model on Groq when Gemini is unavailable. I wrote up that Gemini to Groq fallback separately. A fallback means part of your traffic runs on a different price list, and retries add calls. I also budget for Gemini 3.8 Flash at its January 2027 price, not the promotion, because an estimate built on a promo price stops being true on a known date.

Agents and batch jobs

Agent features multiply calls, so estimate requests per user action, not per click. A single "research this company" button can trigger a plan, several searches, a draft and a review. My OpenAI Agents API guide covers cost controls for that case. Work that can wait, like weekly reports, belongs in a batch job at half price.

Free tiers

The Gemini API free tier currently includes Gemini 3.5 Flash-Lite and Gemini 3.8 Flash at no charge, with rate limits, and Google's pricing page notes that free-tier content may be used to improve its products. That makes it a good place to prototype and measure your token counts. I would not put customer data through it, and I would not plan a launch around it, because limits and terms are set by the provider and can change.

Pricing your AI feature: margin and break-even

Cost per user only matters next to revenue per user. Continuing the support example on Claude Sonnet 5.5, suppose you charge $29 per user per month, have $2.50 per user of other variable costs (hosting, email, payment fees) and $500 of fixed monthly costs:

  • Revenue: 1,000 × $29 = $29,000
  • Total cost: $648 API + $2,500 variable + $500 fixed = $3,648
  • Gross margin: about 87%
  • Break-even price: $3.65 per user

The calculator shows the same figures and a plain verdict. A negative margin means the plan loses money at that price. A positive margin under 60% means usage or pricing may need tighter limits. Above that, the price covers estimated usage with room for overhead. These thresholds are my planning rule, not an industry standard.

Two SaaS team members reviewing AI feature pricing and margin on a laptop
Check the margin for heavy users separately; averages hide the accounts that cost the most.

Averages hide power users. If your top 10% of users send five times more requests, run the calculator again with their numbers, and decide whether you need a fair-use limit or a usage-based tier. I covered the billing side in Stripe per-seat billing for SaaS, and the SaaS Metrics Calculator handles MRR, LTV and CAC once the price is set.

One honest limitation: the calculator prices cached tokens at the read rate. It does not add Claude's one-time cache write premium or Gemini's hourly cache storage fee, so treat its output as a planning estimate and compare it with your first real invoice.

Practical takeaway

Before you choose a model on API pricing alone, work through this list:

  1. Measure real input and output tokens per request, including system prompt, history and thinking.
  2. Count API calls per user per month, not clicks.
  3. Try the cheapest model that meets your quality bar first.
  4. Cap output length and cache the stable part of every prompt.
  5. Budget at post-promotion prices, and check margin for heavy users separately.

You can run all of this in the free AI API Cost Calculator, which has presets for chat, support, summarising and document workflows. If you are planning an AI feature for a SaaS product and want a second opinion on the architecture and cost, get in touch.

Keep reading

Explore all articles

AI Engineering

Gemini API Fallback for 429 Errors with Groq in Node.js

Read guide

AI & Automation

OpenAI Agents API vs Agents SDK: SaaS Production Guide

Read guide

SaaS Engineering

Stripe Per-Seat Billing for SaaS: Seat Sync & Webhooks

Read guide