Skip to content

LLM Cost Calculator

Popular

Estimate and compare AI API costs based on tokens, usage, and model pricing.

Loading…

How LLM API pricing works

Most language-model APIs charge for the tokens you send and the tokens the model writes back. Here is what goes into the estimate above.

Input tokens

Everything you send counts: the prompt, system instructions, conversation history, attached documents and tool definitions. Each request is billed for its own input, so a long system prompt is paid for again on every call.

Output tokens

The reply is billed separately and is usually priced several times higher than input. It can't be known in advance, so enter the length you expect. With reasoning models, the “thinking” the model does is typically billed as output too, so include it in your estimate.

Context window

The context window is the most a model can handle in one request: input and output share it. If input plus the expected reply is larger than the window, the request is invalid, so the calculator shows no cost instead of a misleading number.

Tokens per request and monthly usage

Cost per request = input tokens × input price + output tokens × output price (prices are quoted per million tokens). Multiply by how many requests you expect per day or month to plan a budget; the usage calculator does this for each model you selected.

Why different models have different prices

Larger and more capable models cost more to run, and providers price speed, context length and features differently. Tokenizers also differ: the same text can produce more tokens on one model than another, which changes the bill even at the same price per token. Price alone says nothing about which model is right for your task.

Why real billing may differ from an estimate

  • Token counts for non-OpenAI models are estimates; providers count with their own tokenizers.
  • Cached input, Batch API, priority tiers, long-prompt surcharges, tool or search fees and regional pricing can all change the price.
  • Chat APIs add a few tokens of formatting to every message.
  • Prices change: confirm on the provider's official pricing page before you commit to a budget.

Related tools: LLM Token Counter, Context Window Checker and JSON Formatter.

About LLM Cost Calculator

Before a feature ships, someone has to answer what it will cost to run at real traffic. Give the calculator a prompt or a token count, say how long the reply will be, and pick the models to price against each other. It shows the cost of one request for each, then scales that by your requests per day or month. Cached input and Batch API rates apply wherever the catalog has a published price for the model.

Features

  • Prices up to eight models in one comparison table
  • Counted tokens from pasted text or a token count you type
  • Cached input share and Batch API rates where the catalog lists them
  • Daily, weekly, monthly and yearly projections from request volume
  • Warns when expected output exceeds a model's maximum output
  • Share link carries your settings, not your prompt

Limitations

  • Token counts for non-OpenAI models are estimates, so their costs are estimates too; a token count you type is used as entered.
  • Pasted text is limited to 2 MB, and a request whose input plus output does not fit the model's context window gets no cost at all.
  • Prices come from a dated catalog at standard rates. Tool, search, regional and priority-tier fees are not included, and models with such rules are marked as a basic estimate.

How it works

  1. Open the model list, search or filter by provider, and tick the models you want to price.
  2. Choose Paste text to have the tokens counted, or Enter tokens if you already know the input size.
  3. Set the expected output tokens for the reply.
  4. Open Advanced pricing if you want a cached input share or Batch API rates for the models that have them.
  5. Read the cost estimate and context meter for the focused model, and sort the comparison table by cost, price or provider.
  6. Enter your requests per day or per month in the usage calculator to see daily, weekly, monthly and yearly cost for each model.

Example input

Input tokens: 2,500 · Output tokens: 500 · Models compared: GPT-4o, Claude 3.5 Sonnet, Gemini 1.5 Flash

Frequently asked questions