InfyCalculator
💻

LLM Token Cost Calculator

Estimate the cost of an LLM API call or workload from input and output token counts, per-million-token prices and the number of requests.

Input tokens per request
Output tokens per request
Input price
Output price
Number of requests
Loading calculator…

How it works

Cost/request = (input tokens ÷ 1,000,000) × input price + (output tokens ÷ 1,000,000) × output price · Total = cost/request × requests

LLM APIs price input and output tokens separately, and output is usually several times more expensive per token. Because prices are quoted per million tokens, each side is divided by 1,000,000 before multiplying by its rate. Output pricing dominates costs for chatty, generative workloads, while long prompts with short answers are driven by the input side — the input-share figure shows which one is steering your bill.

Worked example

A request with 1,500 input tokens at $3/M and 500 output tokens at $15/M costs (1,500 ÷ 1,000,000) × 3 + (500 ÷ 1,000,000) × 15 = $0.0045 + $0.0075 = $0.012. Across 10,000 requests that is $120.

Frequently asked questions

What is a token?

A token is a chunk of text the model reads or writes — very roughly ¾ of a word in English, so 1,000 tokens is about 750 words. Both your prompt and the model’s response are billed in tokens, which is why longer prompts and longer answers both raise the cost.

Why is output priced higher than input?

Generating each output token requires a full forward pass through the model, whereas input tokens are processed in parallel when the prompt is read. That extra compute per generated token is why providers charge more for output, sometimes 3–5× the input rate.

Does caching or a system prompt change the cost?

Yes — a repeated system prompt is billed as input on every request unless the provider offers prompt caching, which can discount cached input tokens sharply. If you reuse a large fixed prompt, factor any cache pricing into the input rate you enter here.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.