AI API Cost Calculator
Estimate token usage, per-request cost, and monthly spending for any AI or LLM API with custom pricing.
Token & Pricing Estimator
Token estimates are not exact tokenizer counts
This estimator accepts prompt text and converts its length to an approximate number of input tokens using a characters-per-token assumption. That method is convenient before choosing a model, but tokens are determined by each provider’s tokenizer, and the ratio changes with language, code, punctuation, and unusual character sequences. A four-character assumption is only a rough budgeting shortcut, not a token count you should use for hard context-window enforcement.
Estimate input and output spending separately because many API providers charge different rates for tokens received and generated. Multiply each token quantity by its price unit, then scale from one request to the expected daily or monthly request volume. A chat workflow may also resend prior conversation history, making later requests more expensive than the first prompt would suggest.
For a production estimate, inspect actual billed usage from your model provider and sample both short and unusually long requests. Include output limits, failed-request retries, cached prompts, tool calls, and any fixed charges where applicable. Use current provider pricing; figures typed into the calculator are assumptions rather than live vendor quotations.