# AI API cost calculator

URL: https://shahid09.is-a.dev/tools/ai-api-cost-calculator/
Author: Muhammad Shahid (https://shahid09.is-a.dev/)
Free tool · runs in your browser

Estimate what an AI feature or chatbot will cost each month from how many requests it handles and how long they are.

**Quick answer:** LLM APIs charge per million tokens, with separate prices for input (what you send) and output (what the model writes). Monthly cost = requests per month × (input tokens × input price + output tokens × output price) ÷ 1,000,000. This calculator has Anthropic's Claude list prices filled in and accepts custom prices for any other model.

## How to use it

1. **Choose a model or enter prices.** Claude prices are filled in; pick Custom to enter any model's input and output price per million tokens.
2. **Enter your usage.** Requests per day, and average input and output tokens per request.
3. **Read the cost.** Per request, per day, per month and per year.

## Frequently asked questions

### How is LLM API cost calculated?

Input tokens × input price plus output tokens × output price, with prices quoted per million tokens, summed over all requests.

### Why is output more expensive than input?

Generating tokens takes more computation than reading them, so providers price output several times higher.

### How can I lower my AI API costs?

Use prompt caching for long repeated prompts, a smaller model where quality allows, shorter prompts and answers, and batch processing for work that is not urgent.

### Are the prices current?

The Claude prices are Anthropic's published list prices as of October 2026, before discounts such as caching or batching. Check the provider's pricing page before budgeting.

### Does thinking count as output tokens?

Yes. On models that think before answering, the thinking tokens are billed as output, so leave room for them in your estimate.

### How many tokens does a chatbot message use?

It depends on the system prompt, the conversation history and the reply. Because the whole conversation is sent again with every message, a support chat with a long system prompt can use thousands of input tokens per message.

### What is prompt caching and how much does it save?

It reuses a long prompt prefix between requests. Cached input tokens are billed at a fraction of the normal input price, which cuts the cost of bots that resend the same instructions and documents.

### What is batch processing?

Sending many requests to be processed asynchronously at a discount, for work that does not need an immediate answer, such as summarising thousands of documents.

### Which Claude model should I start with?

The one that meets your quality bar on real examples. Measure the cost per completed task: a cheaper model that needs more retries is not cheaper.

### Does this calculator include WhatsApp or hosting costs?

No. It covers model usage only; WhatsApp conversations, servers and databases are billed separately.

## Related

- [LLM token counter](https://shahid09.is-a.dev/tools/llm-token-counter/)
- [AI chatbot ROI calculator](https://shahid09.is-a.dev/tools/ai-chatbot-roi-calculator/)
- [Hire an AI agent and LLM developer](https://shahid09.is-a.dev/hire/ai-agent-developer/)
