Tool
AI API cost calculator
Estimate what an AI agent or app costs each month in API tokens, then get a spending cap to set before it runs and see your profit after token cost. Enter your provider’s current price. It runs in your browser and nothing is sent anywhere.
Your estimate
- Estimated monthly cost
- –
- Suggested monthly cap
- –
- Estimated daily cost
- –
- Suggested daily cap
- –
- Cost per call
- –
Does it make money after tokens?
Enter what you charge for the usage above. Profit here is revenue minus token cost only. Hosting, tools, payment fees and your time come out of it too.
- Monthly revenue
- –
- Profit after token cost
- –
- Margin
- –
- Token cost per task
- –
How the numbers work
| Cost per call | (input tokens × input price + output tokens × output price) ÷ 1,000,000 |
|---|---|
| Daily cost | cost per call × calls per day |
| Monthly cost | daily cost × days per month |
| Suggested cap | cost × (1 + buffer %), rounded up to the cent |
| Tasks per month | calls per day × days per month ÷ API calls per task |
| Monthly revenue | price per task × tasks per month, or your monthly price |
| Profit after token cost | monthly revenue − monthly cost |
| Margin | profit ÷ monthly revenue × 100 |
| Token cost per task | cost per call × API calls per task (your break-even price per task) |
Formulas last checked 9 November 2026. Prices are your inputs; this page lists no vendor prices.
Turn the estimate into real limits
- AI agent spend cap calculator: per-payment, daily and monthly caps when agents also make purchases.
- AI agent spending limits: where to enforce caps so the model can’t talk past them.
- What an AI agent costs: the other costs beyond tokens.
- Fund the session ceiling: why the monthly cap is a backstop, not the live brake.
FAQ
- How do I estimate my monthly AI API cost?
- Multiply calls per day by tokens per call, divide by one million, multiply by your price per million tokens, then multiply by the days you run each month.
- Why are input and output tokens priced separately?
- Many providers charge a different rate for tokens you send (input) and tokens the model writes (output), so enter both prices if your provider lists two.
- What monthly spending cap should I set?
- Set the cap a little above your estimate (the default buffer is 25%) so normal months fit and a runaway loop hits the limit.
- Where do I set the cap?
- Set it in your provider’s billing or usage-limit settings, or in code that counts spend before each call, not in the prompt.
- Does my AI agent make money after token costs?
- Enter what you charge per task or per month. The calculator subtracts the monthly token cost from your revenue to show profit, and divides profit by revenue for your margin. Hosting, tools, payment fees and your time are not included.
- Does this calculator include any vendor prices?
- No, every price is your own input, so copy the current rate from your provider’s pricing page.
Embed this calculator
Add it to your site with one iframe. It loads one small page with no tracking scripts.