AI API cost calculator

AI API Cost Calculator

Create an API cost estimate for your expected monthly usage across OpenAI, Claude, Gemini, and other models from tokens, requests, active users, and current prices.

Quick answer

AI API Cost Calculator calculates estimated per-request, daily, monthly, and yearly model cost and returns a workload forecast from input tokens, output tokens, requests per user, active users, and current verified prices. Use it to compare supported models under the same assumptions; actual bills can differ because of caching, Batch, retries, reasoning tokens, tool calls, and provider changes.

How it is calculated: Cost per request = (input tokens / 1,000,000 x input price) + (output tokens / 1,000,000 x output price)

ModelInput $/1MCached input $/1MOutput $/1MSourceLast verified How we verify
GPT-6.1 Sol$2.00$0.10$10.00Official sourceOct 21, 2026
Claude Opus 5.5$4.00$0.20$20.00Official sourceOct 25, 2026
Grok 4.7$2.00$0.50$6.00Official sourceOct 25, 2026

Prices from official provider pages, verified on the date shown.

Estimate in three steps
  1. Choose a modelUses its verified Standard token rates.
  2. Enter one workloadAdd tokens, requests, and active users.
  3. Read the monthly resultReview cost, drivers, and source evidence.

Example monthly AI API costs

For the same 1,000 input tokens and 500 output tokens per request, these three models produce different monthly estimates. Each example uses 12,000 requests per month and no cached input.

OpenAI

GPT-6.1 Sol

Input tokens / request
1,000
Output tokens / request
500
Requests / month
12,000
Cached input
0%

Estimated monthly API cost$84.00

Pricing verified · Official pricing source

Anthropic

Claude Opus 5.5

Input tokens / request
1,000
Output tokens / request
500
Requests / month
12,000
Cached input
0%

Estimated monthly API cost$168.00

Pricing verified · Official pricing source

xAI

Grok 4.7

Input tokens / request
1,000
Output tokens / request
500
Requests / month
12,000
Cached input
0%

Estimated monthly API cost$60.00

Pricing verified · Official pricing source

Each estimate uses the current listed API token rates for the model and the workload above. The unrounded input and output token cost per request is multiplied by 12,000 monthly requests. Actual bills can change with caching, Batch, long-context rates, billed reasoning tokens, tool calls, other non-token charges, or provider price changes. For the complete source-linked records, view the AI API pricing dataset.

Choose the right cost tool for your workload

Use this calculator to estimate one model. Compare two models for the same workload. Splitting requests across multiple models? Use the AI Budget Planner to estimate a weighted traffic mix. Estimate retries and conditional fallback costs when failed attempts can add spend.

Open AI Budget Planner
Pricing disclaimer

Estimates for planning only, not financial or legal advice. Prices can change, so verify on the provider's pricing page; your provider bill is the final source of truth. Full terms

Where prompt caching fits in an API cost estimate

Cached-input pricing can lower repeated input cost when provider rules and the workload make that content eligible. For the full verified write/read, lifetime, mode, and first-saving-point decision, calculate whether verified Anthropic prompt caching saves money for your workload.

Already comparing a current route with a replacement? Calculate the verified monthly bill change before switching models under the same token workload.

Generating audio with Google? Use the Gemini 3.8 TTS Cost Calculator to convert verified audio-token rates into minutes, hours, and monthly speech workloads.

What is an AI API cost calculator?

An AI API cost calculator estimates how much an AI workflow may cost before it reaches production. It combines model prices with input tokens, output tokens, requests per day, active users, and monthly volume so teams can compare models on the same workload before launch.

Create an API cost estimate for your expected monthly usage. Use it when you need a planning number before a feature ships: enter expected input tokens, output tokens, requests per user per day, active users, and model pricing to calculate monthly AI model costs for one workflow. For page-based OCR and file parsing instead, compare OCR API costs by monthly pages. Planning a multi-step agent or automation? Estimate the cost of a multi-step AI workflow before using this single-workflow estimate as the baseline. If token counts are still unknown, estimate token usage first, compare API pricing across AI models, and review the free OpenAI API key guide before treating credits or trial access as a launch budget.

Monthly AI API cost formula

Cost per request = (input tokens / 1,000,000 x input price) + (output tokens / 1,000,000 x output price)

Daily cost equals per-request model cost multiplied by billable request volume. A monthly AI API cost calculator multiplies that usage by active users and days in the month, then advanced planning can adjust for cache hits, retries, successful task rate, customer count, and target gross margin. Start from representative real requests, not average guesses: estimate prompt and context size as input tokens and the model response as output tokens, then repeat the same assumptions for each model you compare. Output tokens are often priced higher than input tokens, so long answers, JSON responses, retries, and agent steps can raise the bill even when the prompt is short.

Worked examples

Example: AI chatbot API cost

For a support chatbot, one request may include the customer question, recent conversation history, retrieved help-center context, and a generated answer. If one active user triggers 8 AI replies per day, each reply uses 1,200 input tokens and 400 output tokens, and the product has 1,000 active users, the monthly model bill is driven by 240,000 requests.

Example: article summarizer API cost

For an article summarizer, input tokens are usually the article text and instructions, while output tokens are the summary, bullets, tags, or JSON fields. A summarizer with long source documents may look cheap per request but become expensive when editors or users run hundreds of summaries per day.

Total cost of an AI system, including the API calls

The model bill is one line of the total. To calculate what an AI system costs per month, add the token-priced lines (model calls, retries and fallbacks, embeddings), then the fixed bills from your own vendors (vector store, hosting, monitoring), and subtract any caching or Batch savings you have verified for the workload.

Monthly total = model calls + retries and fallbacks + embeddings + vector store + hosting + monitoring − caching and Batch savings

Example: a support assistant that answers 18,000 questions a month on Claude Sonnet 5.5, with 4,000 input tokens per request (system prompt, retrieved help-center chunks and recent turns), 400 output tokens, a 5% retry rate, and 20,000 help-center chunks of 800 tokens embedded with text-embedding-3-small.

Monthly cost lines for the example support assistant. Only token-priced lines are calculated here.
Cost lineWhat drives itHow to estimate itExample per month
Model callsInput and output tokens per request × requestsThis calculator$216.00
Retries and fallbacksFailed attempts that resend the same tokens, or move to a second modelLLM Retry Cost Calculator$10.80
EmbeddingsCorpus tokens once, then re-embedded documents and query tokens each monthEmbedding API pricing$0.04 (plus $0.32 once to index the corpus)
Vector storeStored vectors, read and write units, or a fixed planYour vector database planNot priced here
HostingApp servers, workers, serverless runtimeYour cloud billNot priced here
Monitoring and logsTrace volume and log retentionYour observability planNot priced here
Caching and Batch savingsRepeated prompt prefix; requests that can wait for an asynchronous batchPrompt Caching Savings Calculator, Batch Token CalculatorNot applied in this example

The token-priced lines come to $226.84 a month, and the model calls are 95% of that. Embeddings barely register at this size: indexing all 20,000 chunks costs $0.32 once. So the model-call line is the one worth tuning. Take the vector store, hosting and monitoring lines from your actual vendor quotes: they do not scale with tokens, so a percentage of the API bill is the wrong way to estimate them.

Claude Sonnet 5.5 at $2 input and $10 output per million tokens, verified (Anthropic pricing). text-embedding-3-small at $0.02 per million tokens, verified (OpenAI pricing). Standard rates, 30-day month, no cached input; 10% of chunks re-embedded each month and 30 tokens per query embedding.

Check provider prices before you estimate

If your workload is provider-specific, review the matching source page before entering token prices here: check the current OpenAI API pricing for GPT routes, compare Claude token prices for Anthropic workloads, or review Gemini API pricing when context caching or multimodal usage may affect the estimate. For a normalized source-linked export, review the AI API pricing dataset. Checking a provider update? Read how to verify OpenAI API pricing changes.

For developer-tool usage that does not behave like a normal app API call, use the Claude Code Cost Calculator to estimate per-developer usage before folding that spend into a broader monthly AI budget.

Related tools and guides

For bulk prompts, support tickets, or CSV-style workloads, Estimate bulk CSV and Batch API cost from row-level tokens and expected outputs. If a prompt is too long or repeats expensive context, use the Prompt Cost Optimizer. After the estimate, learn how to reduce token usage by cutting repeated context. For SaaS launch planning, move the monthly estimate into the AI Budget Planner to model margin, routing, cache savings, retries, and subscription assumptions.

For a scaled SaaS example, read the OpenAI API cost for 10,000 users guide. If support automation is the workflow, see the full customer support chatbot API cost breakdown. If you arrived here after searching for a free OpenAI API key, read whether free unlimited API keys are realistic. For spend controls after launch, read AI API cost control.

Estimate OpenAI and Claude monthly spend step by step.

Use the OpenAI API cost guide when you need a practical walkthrough for tokens, requests, active users, and monthly AI API spend.

Read Monthly Cost Guide
Already have usage and need to reduce the bill?

Use the AI API cost reduction guide to combine prompt cleanup, model routing, caching, batching, and budget limits.

Read Reduction Guide

Frequently asked questions

How do I calculate AI API cost?

Start with one request: input tokens, output tokens, and the selected model's prices. Multiply the per-request cost by requests per user per day, active users, and 30 days to create a monthly AI API cost estimate.

Can I estimate AI API usage costs before launch?

Yes. Use the AI API Cost Calculator to estimate AI API usage costs from expected input tokens, output tokens, request volume, active users, and model pricing before production traffic starts.

What affects OpenAI API cost the most?

OpenAI API cost is usually driven by model choice, input-token volume, output-token length, request frequency, active users, retries, and whether repeated context can use cheaper cached-input pricing.

Why do output tokens matter?

Output tokens are generated by the model and can be priced differently from input tokens. Long answers, JSON responses, summaries, and agent steps can make output tokens a large part of the monthly API bill.

Can I estimate Claude and Gemini costs too?

Yes. Use the same input tokens, output tokens, and request assumptions, then choose a Claude, Gemini, OpenAI, or other model from the pricing list to compare LLM API cost across providers.

Is this calculator enough for monthly SaaS budgeting?

It is a good request-level starting point. For SaaS budgeting, also model cache hit rate, retries, model routing, cost per successful task, target gross margin, and subscription pricing in the AI Budget Planner.

What should I use for bulk prompts or CSV rows?

Use the Batch Token Calculator when you need to estimate token counts for many prompts, support tickets, document chunks, or CSV rows before moving representative examples into the AI API Cost Calculator.

How do I calculate the total cost of an AI system, including API calls?

Add the token-priced lines first: model calls, retries and fallbacks, and embeddings. Then add the fixed bills from your own vendors for the vector store, hosting and monitoring, and subtract caching or Batch savings only where you have verified them. This calculator covers the model-call line; the retry calculator and embedding pricing page cover the next two.