Tools

LLM API cost calculator

Price a workload across 46 models from OpenAI, Anthropic, Google, DeepSeek, Qwen, Mistral, xAI and more, from a token count or from your actual prompt.

Runs in your browserAI developer tools58.8K
Free

Input

0 B

Result

The result will appear here.

Before shipping a feature on an LLM you need a number: what will a thousand, or a million, of these requests cost? Enter the input and output tokens of one request and how many requests you expect — or paste the prompt itself and let the tool count it — and it prices the workload on the model you pick and on 45 others, cheapest first. Prices come from a dated snapshot of the price table maintained by LiteLLM (BerriAI/litellm, MIT), the open-source gateway that many teams use to track spend, and the snapshot date is printed with every result.

How it works

  • Cost is input tokens × the input price plus output tokens × the output price, per million tokens, multiplied by the number of requests; the stats split the total into its input and output shares.
  • Pasted text is counted with o200k_base, which is exact for OpenAI's GPT-4o, GPT-4.1 and GPT-5 families and an estimate for everyone else; when text is present, the input-token field is ignored.
  • Long-context pricing is applied when one request's input passes the provider's threshold — for example above 272K tokens on GPT-5.4 to 5.6, and above 200K on Gemini 2.5 Pro, Gemini 3.1 Pro and Grok — and Qwen's stepped prices are applied per tier.
  • The comparison table marks your model with ▶, and puts ✗ next to any model whose context window cannot hold the request's input and output together.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Are these prices current?
They are a snapshot, and the date is shown in the output. Providers cut prices often and add new models every few weeks, so for a contract or a budget sign-off, check the provider's pricing page. The snapshot is taken from LiteLLM's table and updated by hand, not fetched live.
Does it include cached-input or batch discounts?
No; it prices every input token at the standard rate. The discounted cached-input price is shown as a stat where the provider offers one, so you can work out the saving on a prompt prefix that repeats. Batch APIs, which usually halve the price in exchange for results within 24 hours, are not modelled.
How do I account for reasoning tokens?
Reasoning models such as o3, GPT-5, DeepSeek-reasoner or Claude with extended thinking bill their hidden reasoning as output tokens. Add your expected reasoning budget to the output-token field; the usage block of a real response, which the SSE stream decoder on this site can read, tells you how many a typical request used.
Why is DeepSeek V4 listed under Fireworks and Llama under Groq?
Open-weight models are sold by many hosts at different prices, and the snapshot uses one representative host per model: Groq for Llama 3.1 and 3.3, DeepInfra for Llama 4 Maverick, Fireworks for DeepSeek V4. The provider column says which, so you know whose price you are looking at.

The open-source behind it

This tool is a self-contained implementation. BerriAI/litellm (MIT) does the same job as a library — if you need this behaviour inside your own program, start there rather than calling a web page.

BerriAI/litellm

Also known as

  • llm cost calculator
  • openai api pricing calculator
  • gpt cost per token
  • claude api cost
  • deepseek api price
  • token price comparison