Calculate the dollar cost of an LLM prompt based on token count and model pricing.
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.
cost = tokens * (price_per_million / 1000000)
No, this only covers the input (prompt) tokens. Use the Total API Cost Calculator to include completion tokens and request volume.
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.
No, these are illustrative reference prices. Providers update pricing periodically, so always confirm current rates on the official pricing page before budgeting.
Some providers offer discounted rates for cached or repeated prompt prefixes. This calculator assumes standard, non-cached pricing.