LLM tokens and cost
LLM API cost calculator.
Enter the tokens in and out of a request and the per-million-token prices from your provider. Prices are yours to type in; none are built in.
Cost = input tokens x input price / 1,000,000 + output tokens x output price / 1,000,000. With 2,000 input tokens at an example $2.00 per 1M and 500 output tokens at an example $8.00 per 1M, one request costs $0.008000, so 1,000 requests cost $8.00.
Your numbers
Result
Worked example
2,000 input tokens and 500 output tokens, with an example input price of $2.00 and output price of $8.00 per 1M tokens. Input: 2,000 x 2 / 1,000,000 = $0.004000. Output: 500 x 8 / 1,000,000 = $0.004000. One request: $0.008000. Per 1,000 requests: $8.00. If the same request also uses 1,000 reasoning tokens billed as output, the output side becomes 1,500 x 8 / 1,000,000 = $0.0120 and the request costs $0.0160.
How it works
Providers quote prices per million tokens, usually with separate rates for input and output. The page multiplies each token count by its price and divides by 1,000,000. Anthropic's context window documentation says thinking tokens are billed as output tokens; other providers and models may differ, so check how yours bills reasoning before you rely on that field.
This is the plain cost of one request. It ignores cached-input discounts, batch discounts, taxes, minimum charges and tool or search fees; the prompt caching and batch calculators cover the first two. Use the token estimator if you only know the text length.
Sources and basis (opened 2026-10-08): Context windows - Claude Platform Docs. Everything else is arithmetic on your inputs.
All prices on this page are examples you can overwrite, not any provider's current prices. Check your provider's pricing page before you rely on a number. Results are planning estimates, not a quote or financial advice. Everything runs in your browser. Nothing you type is sent or stored.
FAQ
How do I calculate the cost of an LLM API request?
Multiply input tokens by the input price per million and divide by 1,000,000, then do the same for output tokens and add the two. With 2,000 input tokens at $2.00 per 1M and 500 output tokens at $8.00 per 1M the request costs $0.008000.
Why are output tokens priced differently from input tokens?
Many providers publish separate input and output rates, so the page asks for both. The ratio varies by provider and model, so enter the rates from your provider's pricing page.
Are reasoning tokens billed?
It depends on the model and provider. Anthropic's documentation says thinking tokens are billed as output tokens. Add them in the reasoning field if your provider bills them that way.
Does this include prompt caching or batch discounts?
No. This is the standard cost with no discounts. Use the prompt caching and batch calculators to see those effects.