Tokens to Dollars: Calculate an AI API Request
A worked input and output token calculation, with the billing categories that a simple token converter cannot include.
By TokenRate · Published · Updated
TL;DR
Multiply input tokens by the input price, output tokens by the output price, then divide each by one million and add them. A single total token count cannot give an exact bill when input and output have different rates.
Primary sources
Frequently Asked Questions
Can I convert one million tokens into one fixed dollar amount?
No. The amount depends on the model, provider, input/output mix and any special billing categories.
Are reasoning tokens free?
Usually not. Check the provider's usage record and pricing rules. When reasoning is already included in reported output tokens, do not add it again.
Try the TokenRate Calculator
Use the TokenRate tools to calculate cost from your own usage and the current model rates.
Open Calculator →Related Reading