Article
How much it costs to run AI in your app
AI in an app costs money every time it’s used. The model provider, such as OpenAI or Anthropic, charges for the text each request sends and receives. The cost depends on three things: how much text each request carries, which model answers, and how often it runs. I measure the cost per request first, then choose the model and the calls to match.
What you pay for
Providers charge by the amount of text the AI reads and writes. A question that sends a long document costs more than one that sends a sentence.
What drives the cost
- How much text each request sends: whole documents, long chat histories and long instructions all add up.
- Which model answers: larger models cost more per request than smaller ones.
- How many times each action asks the AI: some features ask it several times for one click.
- How often it runs: per user, per day, per document.
Measure the cost per request first
Before changing anything, measure what one request costs, for each AI feature in the app. Multiply by how often it runs. That shows which feature is worth working on. Guessing usually picks the wrong one.
Ways to keep it down
- A smaller model for simple steps. Sorting, extracting and short answers often don’t need the largest model.
- Send less text. Search for the passages that matter instead of sending every document. See how to get an AI chatbot that answers from your company’s documents.
- Reuse answers. The same question with the same documents can return a stored answer.
- Ask the AI fewer times per action.
- An open model on your own server. You pay for the server each month instead of per request. It also keeps your data on your server.
Any change to the model is checked against a test set before it ships, so a cheaper model doesn’t quietly give worse answers. See how to know if your AI feature gives the right answers.
FAQ
Can I cap the monthly bill? Most providers let you set a spending limit. Set one, and decide what the app shows people when the limit is reached.
Is a model on my own server free? No. You pay for the server every month, busy or not. It pays off when requests are steady and frequent.
What will my AI feature cost to run? It depends on the three things above. I measure it on your feature before giving a figure.
Is your AI bill growing faster than your users?
Tell me what the AI does in your app and roughly how often, and I'll tell you where I'd look first.