Checked November 12, 2026 against OpenAI's API pricing docs, Anthropic's pricing docs and Google's Gemini API pricing page (US prices). This is a documentation-based guide, not a hands-on test.
Quick verdict
The formula: (input tokens x input price) + (output tokens x output price), per request, times requests per month.
The biggest swing: model choice. The same 10,000-conversation workload below ranges from about $4.50 to $450 a month depending on the model.
Then adjust: subtract for caching and batch, add for web search, long prompts and a safety buffer.

Illustration: AI Tool Audit, created with Google Gemini
On this page
Step 1: define one unit of work
Start with the smallest repeatable thing your app does: one support conversation, one document summary, one code review. You will price that unit, then multiply. Trying to estimate "the whole app" at once is how budgets go wrong.
Step 2: measure input and output tokens
For your unit, count:
- Input: system prompt, user message, any documents or retrieved text, tool definitions, and in a chat, all earlier turns resent with each reply.
- Output: the reply, plus hidden thinking on reasoning models. Google bills thinking as output.
Don't guess. Anthropic's token counting endpoint is free (with rate limits) and returns input tokens for a real request. Google offers countTokens for Gemini. Run 20 or 30 realistic examples and take the average. If tokens are new to you, read AI tokens explained first.
Count on the model you plan to use. Anthropic notes that Claude Opus 4.7 and later produce about 30% more tokens for the same text than older Claude models, so old counts can understate cost.
Step 3: apply the price per million tokens
Prices are quoted per million tokens (MTok). A sample from the vendors' current pages:
| Model | Input per MTok | Output per MTok |
|---|---|---|
| OpenAI gpt-6-astra | $10.00 | $50.00 |
| OpenAI gpt-5.4-mini | $0.75 | $4.50 |
| Claude Sonnet 5.5 | $2 | $10 |
| Claude Haiku 5.5 (prompts up to 100,000 tokens) | $0.10 | $0.50 |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 |
Step 4: a worked example
Say you run a support assistant with 10,000 conversations a month. Each averages 2,000 input tokens and 500 output tokens. That is 20 million input tokens and 5 million output tokens a month.
| Model | Input cost | Output cost | Monthly total |
|---|---|---|---|
| Claude Haiku 5.5 | $2.00 | $2.50 | $4.50 |
| Gemini 3.5 Flash-Lite | $6.00 | $12.50 | $18.50 |
| OpenAI gpt-5.4-mini | $15.00 | $22.50 | $37.50 |
| Claude Sonnet 5.5 | $40.00 | $50.00 | $90.00 |
| OpenAI gpt-6-astra | $200.00 | $250.00 | $450.00 |
These are list prices before discounts or extras. The lesson: test whether a small model is good enough before defaulting to a flagship. A hundredfold price gap is common.
Step 5: subtract the discounts
- Batch: OpenAI lists Batch and Flex at 50% off standard rates, and Anthropic's Batch API is 50% off input and output. Use it for work that can wait, like overnight document processing. Google also lists lower batch prices for Gemini.
- Caching: if most of your input is a repeated system prompt or reference text, cached reads are far cheaper. OpenAI lists cached input on gpt-5.4-mini at $0.075 per MTok, a tenth of the normal rate. Anthropic charges cache hits on Sonnet 5.5 at 0.05x input, but cache writes cost more than normal input, so caching only pays when the prefix is reused often.
Step 6: add the extras people forget
- Web search: Anthropic charges $10 per 1,000 searches plus the tokens of the results. Google gives 5,000 free grounding requests a month across Gemini 3 and newer models, then $14 per 1,000.
- Long prompts: some models cost more past a size threshold. Gemini 3.1 Pro Preview goes from $2 to $4 input and $12 to $18 output per MTok above 200,000 tokens, and Claude Haiku 5.5 rises to $0.50 input and $2.50 output for prompts over 100,000 tokens.
- Speed and region: OpenAI's Fast mode costs 2x standard. Anthropic adds a 1.1x multiplier for US-only inference on recent models.
- Tool overhead: declaring tools adds input tokens to every request.
- Scheduled price changes: Google lists Gemini 4 Carbon rising from $2/$10 to $4/$20 per MTok on December 1, 2026, and Gemini 3.8 Flash rising on January 1, 2027.
Step 7: add a buffer and set limits
Real usage drifts. Users write longer messages, chats run longer, and retries add calls. Add 20% to 30% to your estimate as a working buffer, then compare it with real invoices after the first month. Log the usage figures returned with every API response; they are the numbers you are billed on. Finally, check each provider's console for spending limits or usage alerts, so a bug in your code cannot quietly run up a large bill.
Which approach suits you?
- Prototype: estimate with a small model, then test quality. Upgrade only the steps that need it.
- Steady production traffic: design prompts so the fixed part comes first and can be cached.
- Bulk back-office jobs: use batch pricing wherever a delay is acceptable.
For full price lists, see our OpenAI API pricing, Anthropic API pricing and Gemini API pricing explainers. Cheaper providers are covered in our DeepSeek pricing explainer, and every plan we track is in the AI tool price table.
FAQ
How do I calculate the cost of one API call?
Multiply input tokens by the input price per million, add output tokens times the output price per million, and divide by one million. Then add any tool or search fees.
Why is my real bill higher than my estimate?
Common causes are chat history resent each turn, hidden thinking tokens billed as output, tool definitions, web search fees and retries. Measure real usage and add a buffer.
How much does batch processing save?
OpenAI and Anthropic both list batch processing at 50% off standard token prices. Results arrive later rather than instantly.
Is token counting free?
Anthropic's token counting endpoint is free, subject to rate limits. Google provides a countTokens call for Gemini.
Sources
- OpenAI API pricing docs (checked November 12, 2026)
- Anthropic pricing docs (checked November 12, 2026)
- Anthropic token counting docs (checked November 12, 2026)
- Google Gemini API pricing (checked November 12, 2026)
- Google Gemini API: understand and count tokens (checked November 12, 2026)




