AI API Cost Calculator

Estimate what your LLM feature will cost per request, per day, and per month - before the invoice arrives.

Model Preset

Select a preset or edit the rates below for custom pricing.

Gear & Books for AI Builders

Affiliate disclosure: as an Amazon Associate we may earn from qualifying purchases. Links below are placeholders until an affiliate tag is added.

How This Calculator Works

AI providers bill per token, with input tokens and output tokens priced separately. Enter the average tokens your feature sends and receives per request, along with the provider's current per-million-token rates, and this calculator projects the total cost at your expected traffic.

  • Input cost per request = input tokens ÷ 1,000,000 × input price
  • Output cost per request = output tokens ÷ 1,000,000 × output price
  • Cost per request = input cost + output cost
  • Monthly cost = cost per request × requests per day × days per month
  • Yearly cost = monthly cost × 12

Why Output Tokens Cost More

Generating text is more compute-intensive than reading it, so most providers charge several times more for output tokens than input tokens. That means the length of your prompts matters, but the length of the model's responses usually matters more. Cap response length where you can, and reserve long outputs for the cases that genuinely need them.

Ways to Lower Your AI API Bill

  • Trim system prompts and remove repeated context from every request.
  • Use prompt caching where the provider offers it for static instructions.
  • Route simple tasks to cheaper models and reserve premium models for hard cases.
  • Set a max output token limit so runaway generations cannot blow the budget.
  • Batch non-urgent jobs with a batch API when the provider discounts them.
  • Track tokens per feature so one noisy endpoint does not hide inside the total.

Prices Change, So Use Your Own Rates

The presets are illustrative. Provider pricing, context limits, and discounts change frequently, so replace the input and output prices with the current rates from your provider's pricing page. If you use several models, calculate each one separately and add the monthly totals together.

Frequently Asked Questions

How much does one AI API request cost?

It depends on the model and token counts. A request with 800 input tokens and 400 output tokens on a mid-tier model priced at $3 and $15 per million tokens costs about $0.0084. Small numbers per request become significant at thousands of requests per day.

Should I budget by requests or by tokens?

Budget by tokens. Requests are a convenient way to estimate traffic, but the bill is driven by token volume, and average tokens per request often grow as prompts and conversation history get longer.

Does this include embedding or image costs?

No. This calculator covers text input and output tokens only. Embeddings, image generation, speech, and fine-tuning are usually priced differently and should be estimated separately.

Is this calculator free?

Yes, it is completely free and requires no signup.