AI & LLM

LLM API Cost Calculator

Model your monthly spend on GPT-5, Claude, or Gemini before you ship. Adjust tokens per request and monthly volume — the estimate updates live.

Average prompt length, incl. system prompt and context.
Average completion length.
Estimated monthly cost $0.00 GPT-5
Input cost$0.00
Output cost$0.00
Tokens / month0

How this estimate is built

LLM providers bill input and output tokens separately, because generating a token costs meaningfully more compute than reading one — most providers price completions at 3-5x the prompt rate. This calculator multiplies your average tokens-per-request by your monthly request volume, applies the provider's published per-million-token rate, and sums input and output cost.

It doesn't account for prompt caching, batch API discounts (typically 50% off for non-realtime workloads), or volume-tier pricing — all of which can cut real spend well below this estimate. Treat this as a ceiling, not a bill.

Frequently asked questions

How is LLM API cost calculated?

Cost = (input tokens ÷ 1,000,000 × input rate) + (output tokens ÷ 1,000,000 × output rate), multiplied by request count. Rates are published per-million-token by each provider.

Why is output pricing higher than input pricing?

Generating tokens requires a sequential forward pass per token, while input tokens are processed in parallel and can be cached. Most providers price output at 3-5x the input rate.

Does prompt caching reduce cost?

Yes. Anthropic and OpenAI both offer cached-input pricing, typically 50-90% cheaper than standard input tokens, for repeated system prompts or long shared context.

Related calculators

Embedding API cost · AI agent cost · AI coding tool cost