AI API Cost Calculator

Enter the input and output tokens of a typical request, how many requests you make a day and your prices per million tokens, and get the cost per request, per day, per month and per year, plus how the bill changes if volume or length changes. Prices are yours to type; a preset only fills them in for you.

Processed locally in your browser. Your data is not uploaded to our servers.

Prompt, context and documents sent with each request.

The reply, including any reasoning tokens that are billed as output.

Average number of requests you make in a day.

A preset only fills in the three price fields. You can edit them afterwards.

The price for reading input from the prompt cache.

Share of the input tokens read from the cache. Needs a cached input price.

30 by default. Use 30.42 for an average month or 22 for working days.

Preset prices are standard pay-as-you-go API prices in USD per million tokens, read from each provider’s pricing page and last verified 2026-10-19. Providers change prices often: confirm on the provider’s page.

Price sources:

Result

Estimate

Enter your tokens, requests and prices to see the cost.

Examples

Worked examples at example prices of 2 USD input and 10 USD output per million tokens (30-day month, no caching):

WorkloadTokens in / outRequests per dayPer requestPer month
Support chatbot1,500 / 3002,0000.006 USD360.00 USD
Assistant over retrieved documents6,000 / 5005000.017 USD255.00 USD
Long document summaries40,000 / 8001000.088 USD264.00 USD

AI API price reference

These are the standard pay-as-you-go prices behind this calculator’s presets, listed by provider. They come from the same data the calculator uses, and each row shows the day its values were last compared with the provider’s own pricing page.

All prices are in USD per 1,000,000 (one million) tokens. “Cached input” is the price to read a prompt prefix from the provider’s prompt cache; “cache write” is the price to store one there. Batch prices apply to asynchronous batch requests.

Anthropic: standard and batch prices (USD per 1M tokens)
ModelInputOutputCached input (read)Cache writeBatch inputBatch outputVerified
Claude Fable 5.110.00 USD50.00 USD0.25 USD12.50 USD5.00 USD25.00 USD
Claude Opus 5.54.00 USD20.00 USD0.20 USD5.00 USD2.00 USD10.00 USD
Claude Sonnet 5.52.00 USD10.00 USD0.10 USD2.50 USD1.00 USD5.00 USD
Claude Haiku 4.51.00 USD5.00 USD0.10 USD1.25 USD0.50 USD2.50 USD

Official source: Anthropic pricing page

OpenAI: standard and batch prices (USD per 1M tokens)
ModelInputOutputCached input (read)Cache writeBatch inputBatch outputVerified
gpt-6-astra10.00 USD50.00 USD1.00 USD12.50 USD5.00 USD25.00 USD
gpt-6.1-sol2.00 USD10.00 USD0.10 USD2.50 USD1.00 USD5.00 USD
gpt-5.4-mini0.75 USD4.50 USD0.075 USDN/A0.375 USD2.25 USD
gpt-6-luna0.10 USD0.50 USD0.01 USD0.125 USD0.05 USD0.25 USD

Official source: OpenAI API pricing page

Google: standard and batch prices (USD per 1M tokens)
ModelInputOutputCached input (read)Cache writeBatch inputBatch outputVerified
Gemini 3.1 Pro PreviewPrice for prompts up to 200,000 tokens; longer prompts cost more.2.00 USD12.00 USD0.20 USDN/A1.00 USD6.00 USD
Gemini 2.5 FlashGoogle currently limits access to the Gemini 2.5 models to users who have used them before. The model is not deprecated and no shutdown date is announced. Google’s model page0.30 USD2.50 USD0.03 USDN/A0.15 USD1.25 USD

Official source: Gemini API pricing page

N/A means ToolQuarter does not record that price for the model, for example because the provider lists no such price or bills it another way (cache storage billed per hour is not modelled). It never means zero.

How to read these prices

  • Prices change often, and providers rename and retire models. The provider’s own pricing page is always the authority: confirm a price there before you rely on it.
  • ToolQuarter lists only the models its calculators offer as presets. This is not a complete list of any provider’s models or prices, and it is not a real-time feed.
  • Standard prices for the provider’s usual prompt size are shown. Long-context tiers, regional or data-residency surcharges, cache storage fees, tool and search charges, flex and priority tiers and taxes are not included.
  • These figures are for planning and comparison. A price you enter yourself in the calculator always takes precedence over a preset.
  • ToolQuarter is independent. It is not affiliated with, endorsed by or sponsored by Anthropic, OpenAI or Google; their names are used only to say whose prices are shown.

Formula & Methodology

The arithmetic is exact for the numbers you enter:

cost per request = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000with caching: the cached share of the input tokens is charged at the cached input price insteadper day = cost per request × requests per dayper month = per day × days per month; per year = per day × 365

Good to know

  • Token counts and prices are your inputs, so the result is only as accurate as they are. Use the token counter for an estimate, or the usage figures in the API response for real numbers.
  • Output tokens usually cost several times more than input tokens, and some models bill reasoning tokens as output. Include them in the output tokens.
  • Not included: batch discounts, cache-write and storage fees, regional multipliers, tool or search charges, free tiers, rate limits and taxes.
  • Months differ: 30 days by default, 365 days for a year. Change the days per month to match your usage.
  • Presets only save typing. Prices change, so check the provider’s page, or type your own negotiated prices.

How to Use

  1. Enter the input and output tokens of a typical request and the requests per day.
  2. Type your input and output prices per million tokens, or prefill them from a preset.
  3. Optionally enter a cached input price and the share of input served from cache.
  4. Read the cost per request, day, month and year, and the sensitivity table.

Frequently Asked Questions

How do I calculate my monthly AI API cost?

Work out the cost of one request (input tokens × input price plus output tokens × output price, each divided by one million), multiply by the requests per day, then by the days in the month. This calculator does all of that and also shows the yearly figure.

Why are input and output tokens priced differently?

Generating output costs the provider more compute than reading input, so output is usually priced several times higher. That is why long replies, and reasoning tokens billed as output, can dominate a bill.

How does prompt caching change the cost?

Input tokens read from the cache are charged at a much lower cached price. Enter that price and the share of input you expect from cache to see the saving. Cache-write and storage fees, where a provider charges them, are not included.

Where do I get my token counts?

The usage fields in the API response give exact input and output tokens per request. Before you have any, estimate with the token counter and plan for a margin.

Do reasoning or thinking tokens count?

On many models they are billed as output tokens even when you do not see them. Add them to the output tokens so the estimate is not too low.

Last updated: