LLM API cost
Prompt cost calculator
What one prompt costs on a model from its length in characters and the expected answer length.
With model gpt-5.4-mini, prompt characters 6,000 characters, answer tokens 400 tokens, calls 1,000, the prompt tokens is 1,500 tokens at list prices read 2026-11-01.
Prompt tokens
Read from vendor pricing pages on 2026-11-01. Arithmetic on list prices, not advice or a quote.
Saving and exports come with Pro, $9 a month. What is in it. The calculator itself is free.
How it works
Characters are converted to tokens with the vendor's rule of thumb (4 characters a token at OpenAI, 2.5 at Anthropic; Google and the others use the OpenAI figure here as an approximation), then priced at list.
The formula
prompt_tokens = characters / chars_per_token (the vendor's rule of thumb); cost = (prompt_tokens * input_price + answer_tokens * output_price) / 1,000,000
Worked example
Inputs
- Model
- gpt-5.4-mini
- Prompt characters
- 6,000 characters
- Answer tokens
- 400 tokens
- Calls
- 1,000
Result
- Prompt tokens
- 1,500 tokens
- Cost per call
- $0.00293
- Cost for calls
- $2.93
Sources
- developers.openai.com/api/docs/pricing (read 2026-11-01)
- platform.claude.com/docs/en/about-claude/pricing (read 2026-11-01)
- ai.google.dev/gemini-api/docs/pricing (read 2026-11-01)
- platform.openai.com/tokenizer (rule of thumb: 1 token is about 4 characters or 0.75 words of English)
- platform.claude.com/docs/en/models/overview (1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer)
Prices read from each vendor's own pricing page on 2026-11-01; the page may have changed since. This is arithmetic on published list prices, not advice or a quote. Check the vendor's page before committing a budget.
Questions
Can I paste the prompt instead?
Related tools
LLM API cost calculator
Monthly and per-request cost of an LLM API workload from input tokens, output tokens, requests a month, cached share and the Batch discount.
LLM price comparison
The same workload priced on every model in the table, cheapest first.
Budget to requests calculator
How many requests and tokens a monthly budget buys on a model.