How LLM APIs are billed
Large language model APIs charge per token, a chunk of text that is often a word or part of a word. As a rough rule for English, one token is about four characters or three quarters of a word, so 1,000 tokens is roughly 750 words. Other languages and code can use noticeably more tokens for the same amount of text.
Providers price input tokens (everything you send: system prompt, conversation history, documents) and output tokens (what the model writes) separately, and output is usually several times more expensive. Prices are quoted per million tokens.
Cost per request = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000
Monthly cost = cost per request × requests per day × days
Worked example
A support assistant handles 1,000 requests a day. Each request sends about 1,500 input tokens and receives 500 output tokens. The model costs 3 per million input tokens and 15 per million output tokens (illustrative prices, in your provider's currency).
- Daily input: 1,500,000 tokens × 3 ÷ 1,000,000 = 4.50
- Daily output: 500,000 tokens × 15 ÷ 1,000,000 = 7.50
- Per day: 12.00; per 30-day month: 360.00; per request: 0.012
Even though output is only a quarter of the tokens, it makes up more than 60% of the bill, which is why limiting answer length is one of the most effective savings.
Where the input tokens come from
- System prompt: instructions sent with every request. A 1,000-token system prompt at 100,000 requests a month is 100 million tokens.
- Conversation history: chat apps resend earlier messages, so long conversations grow more expensive with each turn.
- Retrieved documents (RAG): each chunk of context you add is billed as input.
- Tool or function definitions: sent with every request that may use them.
Ways to reduce cost
- Prompt caching: many providers bill repeated input (for example an unchanged system prompt or document) at a much lower rate when it is cached. Enter the cached share in the calculator to see the effect.
- Batch processing: some providers offer discounts for requests that can wait for results.
- Smaller models: route simple tasks to a cheaper model and keep the large model for hard cases.
- Shorter outputs: ask for concise answers and set a maximum output length.
- Trim context: retrieve fewer, more relevant chunks and summarise old conversation turns.
Budgeting tips
- Measure real token counts from a sample of production traffic; estimates are often off by a factor of two.
- Add a margin of 20–30% for retries, errors and traffic peaks.
- Set spending limits and alerts in the provider's console.
- Prices change often and differ by model; always use the current price list of your provider.
Common mistakes
- Pricing per thousand instead of per million tokens (a factor of 1,000).
- Forgetting the system prompt and history in the input count.
- Using the input price for output tokens.
Example budgets
With the same illustrative prices (3 per million input tokens, 15 per million output tokens):
| Use case | Requests / day | Tokens in / out | Per month (30 days) |
|---|---|---|---|
| Internal helper | 100 | 1,000 / 300 | 22.50 |
| Support assistant | 1,000 | 1,500 / 500 | 360.00 |
| Document summariser | 5,000 | 4,000 / 400 | 2,700.00 |
The document summariser is input-heavy: long documents dominate the cost, which is where prompt caching or a cheaper model for first-pass summaries saves the most.
Cost per user
For a product, divide the monthly cost by active users. If 2,000 users generate the support-assistant traffic above, the AI cost is 0.18 per user per month, which you can compare with what each user pays or is worth to the business.
Context windows and long conversations
Models can accept large context windows, but every token you send is billed. In chat applications the whole conversation is usually resent with each message, so the tenth message of a long chat can cost several times more than the first. Summarising older turns keeps costs predictable.
Frequently asked questions
How much does an AI API cost per month?
Multiply tokens by price: for 1,000 requests a day with 1,500 input and 500 output tokens at 3 and 15 per million tokens, the cost is 12 per day or 360 per month.
How many words is 1,000 tokens?
About 750 English words, as a rough rule. Other languages and code often need more tokens.
Why are output tokens more expensive?
Generating text requires the model to produce tokens one by one, which uses more compute than reading the input.
How can I lower my LLM API bill?
Use prompt caching, shorter outputs, smaller models for simple tasks, batch processing where available, and less context per request.
How do I estimate AI cost per user?
Divide the monthly API cost by the number of active users. For example, 360 per month across 2,000 users is 0.18 per user.
Why do long chats cost more?
Each new message usually includes the earlier conversation as input, so input tokens grow with every turn.
Sources
- Published API pricing pages of major LLM providers (per-million-token input, output and cached-input prices; check current values).
- Provider tokenizer documentation (approximate characters and words per token in English).
Last reviewed 5 October 2026. Results are estimates; see our disclaimer.
