July 11, 2026

How Much Do the OpenAI, Claude and Gemini APIs Cost in 2026 (Guide + Calculator)

Photo of Marco Orta Marco Orta | 9 min read
Compartir
How much the OpenAI, Claude and Gemini APIs cost in 2026: tokens, prices and a cost calculator

AI model APIs are billed by tokens, not by words or by messages. You pay for the tokens that go in (your prompt) and the tokens that come out (the response), at a different price each and per million tokens. In 2026, a typical chatbot call costs between a fraction of a cent and a few cents; what blows up the bill isn’t the unit price, but the volume of calls and the size of your prompts.

This guide explains, with no fluff, how generative AI is billed, how much GPT-5, Claude and Gemini cost today, and how to calculate your real spend before the surprise arrives. At the end there’s an AI cost calculator so you can run your own numbers.

What is a token and why is it what you pay for?

A token is the smallest unit the model uses to process text: a chunk of a word. As a rule of thumb, 1 token ≈ 4 characters ≈ ¾ of a word in English. “How many tokens does this sentence have?” is about 9 tokens.

The key point is that every provider charges two different prices:

  • Input tokens: everything you send — the system prompt, the conversation history, any documents you attach and the user’s question.
  • Output tokens: what the model generates. It’s almost always more expensive than input (3 to 5×), so long answers cost disproportionately more.

This has a huge practical consequence: if your chatbot drags the entire history into every message, you’re paying for that history over and over as input tokens. Measuring is the first step — that’s why I built the token counter, which gives you the exact OpenAI count plus an estimate for Claude and Gemini.

AI API pricing in 2026

These are reference prices (USD per million tokens) as of July 2026. Providers change them often, so always verify on their official page before deciding.

OpenAI (GPT-5.6 and GPT-5.4)

Model Input / 1M Output / 1M Context
GPT-5.6 Sol $5.00 $30.00 400k
GPT-5.6 Terra $2.50 $15.00 400k
GPT-5.6 Luna $1.00 $6.00 400k
GPT-5.4 mini $0.75 $4.50 400k
GPT-5.4 nano $0.20 $1.25 400k

Anthropic (Claude)

Model Input / 1M Output / 1M Context
Claude Opus 4.8 $5.00 $25.00 1M
Claude Sonnet 5 $3.00 $15.00 1M
Claude Haiku 4.5 $1.00 $5.00 200k

Google (Gemini)

Model Input / 1M Output / 1M Context
Gemini 3.1 Pro $2.00 $12.00 1M
Gemini 3.5 Flash $1.50 $9.00 1M
Gemini 3.1 Flash-Lite $0.25 $1.50 1M
Gemini 2.5 Flash $0.30 $2.50 1M
Gemini 2.5 Flash-Lite $0.10 $0.40 1M

The big picture in 2026: the “large” models (GPT-5.6 Sol, Gemini 3.1 Pro, Claude Opus 4.8) sit at a similar price, and the “mini/flash/nano” models are 10 to 50× cheaper and plenty for most use cases (classify, extract data, answer FAQs). One 2026 caveat: recent Claude models use a new tokenizer that produces ~30% more tokens for the same text, so their effective cost is a bit higher than the per-token price suggests.

How to calculate your real cost

The per-call formula is simple:

cost = (input_tokens  / 1,000,000 × input_price)
     + (output_tokens / 1,000,000 × output_price)

A concrete example with GPT-5.6 Terra ($2.50 input / $15 output): a 1,000-token prompt that generates a 500-token response costs:

(1000 / 1,000,000 × 2.50) + (500 / 1,000,000 × 15)
= 0.0025 + 0.0075
= 0.01 USD per call

One cent per call. But multiply it by 1,000 calls a day and it’s ~$10 daily, roughly $300 a month. Switch to GPT-5.4 nano and that same workload drops below $30. That’s the whole game: picking the right model for each task.

To avoid doing this math by hand for every scenario, the AI cost calculator lets you paste your real prompt, see the exact tokens and compare the spend per call and per month across every model at once.

A practical example: a customer-support chatbot

Let’s assume a support assistant for an online store:

  • System prompt + instructions: 800 tokens.
  • Conversation history (average): 1,200 tokens.
  • User question: 50 tokens.
  • Model response: 250 tokens.

Total input = 2,050 tokens; output = 250 tokens. With Gemini 2.5 Flash ($0.30 / $2.50):

(2050 / 1,000,000 × 0.30) + (250 / 1,000,000 × 2.50)
= 0.000615 + 0.000625
≈ 0.00124 USD per message

With 10,000 messages a month, about $12.4. That same chatbot on Claude Opus 4.8 ($5 / $25) would cost about $165 a month: same functionality, more than 13× more expensive. Choosing the right model isn’t a detail — it’s the difference between a profitable project and an unviable one.

If you’re building something like this, my guide on integrating the OpenAI API with Laravel or building an AI agent with Laravel and MCP may help.

7 ways to cut your AI bill

  1. Use the smallest model that does the job. Classifying, summarizing or extracting data rarely needs the top-tier model. Reserve GPT-5 or Opus for complex reasoning.
  2. Shorten the system prompt. It’s text you pay for on every call. Every 100 tokens you remove multiply across your entire volume.
  3. Don’t drag the whole history. Summarize long conversations or use a sliding window of the last N messages.
  4. Leverage prompt caching. OpenAI, Anthropic and Google discount repeated input tokens heavily (up to 90%). If your system prompt is fixed, cache it.
  5. Cap output tokens with max_tokens. Output is the most expensive part; set a reasonable ceiling.
  6. Batch anything that isn’t real-time. Batch APIs usually cost half.
  7. Set spending limits in the provider dashboard. A bad loop can drain your account in hours.

Common mistakes when estimating costs

  • Counting words instead of tokens. A word can be 1 or 3 tokens; in code and JSON the ratio spikes. Measure it with a real token counter.
  • Forgetting the output. Many people calculate only the prompt and get a surprise: output is often 60-80% of the cost.
  • Ignoring the history. In a chat, the cost per message grows as the conversation advances, because context accumulates.
  • Assuming every tokenizer is the same. Claude and Gemini tokenize differently from OpenAI; for the same text there can be a ±15% difference.

Conclusion

The cost of generative AI is no mystery: it’s token arithmetic. Once you understand that you pay input and output separately, that output is more expensive, and that the small model is almost always enough, controlling the bill comes down to measuring and choosing well.

Before wiring any model into production, run the numbers with real data: paste your prompt into the AI cost calculator, check the exact tokens and compare models. Five minutes there can save you hundreds of dollars a month.

Are you integrating AI into your product and want it to be profitable? I can help you with AI automation and integration for your business. Tell me what you’re building.

Compartir

Search

Tags