SourceVane · Practical AI

AI API cost calculator

Compare two AI API budgets using token prices, retries and successful tasks. Enter your own assumptions; no API calls or account required.

Enter your workload

The starting values are illustrative assumptions, not provider prices. Replace them with your measured workload and current quoted rates. Calculations stay in your browser.

Enable JavaScript to change the inputs and compare options. The formula and evaluation guide remain available below.

How the estimate works

For each option, monthly cost = tasks × that option’s average attempts × (input tokens × input price + output tokens × output price) ÷ 1,000,000.

Cost per successful task = monthly cost ÷ (tasks × final success rate). Count success after the allowed retries, using your own acceptance test. cost-v2 keeps each option’s token use and retry rate separate.

Use effective billed rates for your configuration. Cache writes and reads, batch discounts, tool charges, hosting, taxes and subscriptions are not added separately. This estimates token spend, not latency, model quality or a guaranteed invoice.

Compare the estimate with measured usage before budgeting. Measure retry cost · Compare batching and caching.

What happened next · API prices · Decision guides · Latest AI coverage · Follow updates