Prompt Cost Calculator
Calculate the dollar cost of an LLM prompt based on token count and model pricing.
About Prompt Cost Calculator
LLM providers charge per token for input (prompt) and output (completion) separately, with input tokens usually priced lower than output tokens. This calculator multiplies your prompt token count by the model's per-token input price to estimate the cost of sending that prompt. Prices shown are illustrative list prices per million tokens and change frequently — check your provider's current pricing page for exact figures.
Formula
cost = tokens * (price_per_million / 1000000)
- tokens
- Number of prompt tokens
- price_per_million
- Model's price per 1 million input tokens
Worked example
With the default values below, Prompt Cost Calculator returns Prompt Cost of $0.030000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Prompt Tokensaccepts 0–10,000,000 tokens
- 1,000 tokens
- Modelone of GPT-4 (8K), GPT-4 Turbo, GPT-3.5 Turbo, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
- GPT-4 (8K)
Results
- Prompt Cost
- $0.030000
- Cost per 1K Tokens
- $0.03000
- Price per 1M Tokens
- $30.00
Step by step
- 1Price per token: price per 1M tokens ÷ 1,000,000= $0.00003000
- 2Prompt cost: tokens × price per token= $0.030000
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 6 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Is this the total cost of an API call?
No, this only covers the input (prompt) tokens. Use the Total API Cost Calculator to include completion tokens and request volume.
Why do prices vary so much between models?
Larger, more capable models (like GPT-4 or Claude 3 Opus) cost more per token because they require more compute to run. Smaller models like GPT-3.5 Turbo or Claude 3 Haiku are cheaper but less capable.
Are these prices exact?
No, these are illustrative reference prices. Providers update pricing periodically, so always confirm current rates on the official pricing page before budgeting.
Does prompt caching reduce this cost?
Some providers offer discounted rates for cached or repeated prompt prefixes. This calculator assumes standard, non-cached pricing.
