Calculation guide
Enter billable uncached input and output tokens for one month, in individual tokens. Enter prices per million tokens. Include cache, tools or other API charges in other costs once.
Inputs
Monthly uncached input tokens
Example entry 20000000.
Monthly output tokens
Example entry 5000000.
Input price per million tokens
Example entry 2 (in the selected currency).
Output price per million tokens
Example entry 8 (in the selected currency).
Other monthly API charges
Example entry 20 (in the selected currency).
Paying subscribers in month
Example entry 50. Use whole numbers.
Worked example
| Input | Value |
|---|---|
| Monthly uncached input tokens | 20,000,000 |
| Monthly output tokens | 5,000,000 |
| Input price per million tokens | 2 |
| Output price per million tokens | 8 |
| Other monthly API charges | 20 |
| Paying subscribers in month | 50 |
| Result | Value |
|---|---|
| API cost per paying subscriber | 2 |
| Monthly API cost | 100 |
| Input token cost | 40 |
| Output token cost | 40 |
Calculation steps
API cost per paying subscriber = (((((Monthly uncached input tokens × Input price per million tokens) ÷ 1,000,000) + ((Monthly output tokens × Output price per million tokens) ÷ 1,000,000)) + Other monthly API charges) ÷ Paying subscribers in month)
(((((20,000,000 × 2) ÷ 1,000,000) + ((5,000,000 × 8) ÷ 1,000,000)) + 20) ÷ 50) = 2
Monthly API cost = ((((Monthly uncached input tokens × Input price per million tokens) ÷ 1,000,000) + ((Monthly output tokens × Output price per million tokens) ÷ 1,000,000)) + Other monthly API charges)
((((20,000,000 × 2) ÷ 1,000,000) + ((5,000,000 × 8) ÷ 1,000,000)) + 20) = 100
Input token cost = ((Monthly uncached input tokens × Input price per million tokens) ÷ 1,000,000)
((20,000,000 × 2) ÷ 1,000,000) = 40
Output token cost = ((Monthly output tokens × Output price per million tokens) ÷ 1,000,000)
((5,000,000 × 8) ÷ 1,000,000) = 40
How each input affects this example
Each row starts from the worked example and changes one input.
| Input | Original input | New input | Affected result | Original result | New result |
|---|---|---|---|---|---|
| Monthly uncached input tokens | 20,000,000 | 22,000,000 | API cost per paying subscriber | 2 | 2.08 |
| Monthly output tokens | 5,000,000 | 5,500,000 | API cost per paying subscriber | 2 | 2.08 |
| Input price per million tokens | 2 | 3 | API cost per paying subscriber | 2 | 2.4 |
| Output price per million tokens | 8 | 9 | API cost per paying subscriber | 2 | 2.1 |
| Other monthly API charges | 20 | 22 | API cost per paying subscriber | 2 | 2.04 |
| Paying subscribers in month | 50 | 55 | API cost per paying subscriber | 2 | 1.818182 |
