LLM API Cost Calculator

Enter your usage profile and instantly compare what every major LLM provider would charge — per request and per month. The default scenario below is real, server-rendered output; change any field to recalculate live.

Quick scenarios

Tip: you can type 4k, 100k or 1.5m.

Advanced options

Estimated cost — per month

Shown in USD. Pricing last verified 2026-06-19.

API price = the provider's list price per 1M tokens (input → output). Your cost = estimate for the usage profile you set on the left (4,000 in + 1,000 out per request).

Showing 4 of 4 models.

Show:

Tip: click a column header to sort, or filter by category above. Sorted by cost per request by default.

Provider / Model Context API price / 1M in → out Your cost / request Your cost / month Links
xAI Grok Build 0.1 fast cheapest cache 256K $1.00 $2.00 $0.006000 $6.00 Visit
xAI Grok 4.3 fast cache 1M $1.25 $2.50 $0.007500 ×1.3 $7.50 Visit
xAI Grok 4.20 Multi-Agent fast cache 2M $1.25 $2.50 $0.007500 ×1.3 $7.50 Visit
xAI Grok 4.20 fast cache 2M $1.25 $2.50 $0.007500 ×1.3 $7.50 Visit

Estimates only. Actual bills depend on exact token counts, tier pricing and provider changes. Always confirm on the provider's pricing page.

How LLM API pricing works

Every major LLM provider bills by the token — a chunk of text roughly ¾ of a word in English. You pay separately for input tokens (everything you send: system prompt, retrieved context and the user message) and output tokens (what the model writes back). Output is typically priced two to five times higher than input, which is why concise responses save real money at scale.

The formula

cost_per_request = (input_tokens  / 1,000,000) × input_price_per_M
                 + (output_tokens / 1,000,000) × output_price_per_M
cost_per_period  = cost_per_request × requests_in_period

What moves the number

Frequently asked questions

How are LLM API costs calculated?

Providers bill per million tokens, separately for input (your prompt) and output (the model's response). Cost per request = (input tokens / 1,000,000 × input price) + (output tokens / 1,000,000 × output price). Multiply by your request volume for the period.

What is the difference between input and output tokens?

Input tokens are everything you send to the model — system prompt, context and user message. Output tokens are what the model generates. Output is usually priced several times higher than input, so response length matters a lot for cost.

Does prompt caching reduce cost?

Yes, where supported. Repeated prompt prefixes (e.g. a long system prompt) can be billed at a steep discount. The calculator lets you set what share of input tokens are cached.

Why do prices vary so much between providers?

Model size, hardware efficiency, context window, and business strategy all play a part. Frontier reasoning models cost the most; fast/cheap and open-weight self-hosted options can be orders of magnitude cheaper for suitable tasks.