Skip to content

AI Automation

AI API Cost for a Business App: How to Estimate It

AI API cost comes from tokens in and out. See the formula, a worked example with made-up prices, and ways to keep a monthly bill under control.

AI Automation6 min readWritten by the Astrafolio team in NoidaTalk to us about this

Want this done for you? See our ai integration service, or send us a brief.

How is AI API cost calculated?

AI API cost is the number of tokens you send to a model plus the number it sends back, each multiplied by a price per million tokens. Output tokens usually cost more than input tokens. So your monthly bill is roughly requests per month, times tokens per request, times the price.

We do not quote live prices here, because they change often and a wrong number is worse than none. Instead we give you the formula, a worked example with invented prices, and the places to check the real ones. If you want us to build the feature, our AI integration service page explains how we scope it.

What is a token?

A token is a small chunk of text, often part of a word. Models read and write in tokens, not words or characters. The large language model breaks your prompt into tokens, and breaks its answer into tokens too. As a loose habit, a short paragraph is a few dozen tokens and a long document is thousands. Each provider's tools can count tokens exactly for your text, so measure a real sample rather than guessing.

How do OpenAI, Gemini and Claude price their APIs?

All three publish price lists per million tokens, with separate rates for input and output. Always read the official page for the live price and the model you plan to use:

As of November 2026, the Gemini and Claude pages both list a batch option for work that does not need an instant reply. Google's page describes its Batch API as a "50% cost reduction", and Anthropic's page says its Batch API gives a 50 percent discount on both input and output tokens. Both pages also list prices for caching repeated input. We could not open OpenAI's page from our tools when writing this, so check its current batch and caching terms yourself.

Two practical points from those pages. Model prices differ by a large factor between a small, fast model and a top model. And a model that "thinks" before answering may bill those thinking tokens as output. Google's page says its output prices include thinking tokens, so a short visible answer can cost more than it looks.

What is the formula for a monthly estimate?

Work in four steps, with your own numbers.

  1. Tokens in per request: your instructions, plus any documents or history you send, plus the user's message.
  2. Tokens out per request: the length of the answer you expect.
  3. Requests per month: users or items, times how often each happens.
  4. Cost per request: (tokens in ÷ 1,000,000 × input price) + (tokens out ÷ 1,000,000 × output price).

Monthly bill = cost per request × requests per month. Add a margin of 20 to 30 percent for retries and growth. That margin is our rule of thumb, not a published figure.

What does a worked example look like?

This is illustrative, not a quote. The prices below are made up for the maths and are not any provider's real price. Swap in the real ones from the pages above.

Imagine a business app that summarises support tickets. Assume:

  • Invented input price: 2 per million tokens (any currency; the maths is the same)
  • Invented output price: 8 per million tokens
  • Each ticket: 1,500 tokens in (ticket plus instructions), 200 tokens out
  • Volume: 3,000 tickets per month
StepWorkingResult
Input cost per ticket1,500 ÷ 1,000,000 × 20.003
Output cost per ticket200 ÷ 1,000,000 × 80.0016
Cost per ticket0.003 + 0.00160.0046
Monthly bill0.0046 × 3,00013.8
With a 25% margin13.8 × 1.25about 17

The point is the shape of it, not the figure. Per-request cost is tiny, so volume and prompt size decide the bill. A feature that sends a 50-page document on every request, or runs on every keystroke, can cost far more than one that runs once per ticket.

If your estimate is more than you expected, the next section is where to look.

How do you keep the bill down?

  • Use the smallest model that passes your test. Run twenty real cases through a cheaper model first. Move up only if it fails.
  • Send less. Trim instructions, and send only the relevant parts of a document. Retrieval, explained in our RAG entry, exists partly for this reason.
  • Cap the output. Ask for a short answer and set a maximum length.
  • Cache repeated input. If every request starts with the same long instructions, use the provider's caching where its pricing page supports it.
  • Batch work that can wait. Overnight reports do not need an instant answer, and the discounts above apply to batch jobs.
  • Skip the model when a rule works. A simple check or keyword filter costs nothing per call. See AI agent vs chatbot vs automation for when plain automation is enough.
  • Set a spending limit in the provider's console, and log usage per feature so a spike has a name.

What else costs money besides the API?

The model fee is often not the biggest line. Budget for these too.

CostWhat it is
BuildDesign, integration, testing, and handling bad answers
HostingServers or serverless functions that call the model
Storage and searchA database for documents or logs, and a search index if you use retrieval
Logging and monitoringKeeping records of inputs and outputs so you can check quality
Human reviewStaff time to check output, especially at the start
MaintenanceModels are retired and replaced, so prompts need re-testing

For our own price, an AI feature starts from $2,500 on our published AI integration plans. That covers the build, not the running cost.

Who pays the model provider?

You do. In our practice, model usage fees are billed to your own account with the provider, and keys and data stay with you. That means the running cost is visible, you can set limits yourself, and you can switch providers without us. It is also why we ask you to read the estimate with us before building.

If you are still deciding what to add in the first place, start with five ways to add AI to software you already have. Smaller, well-aimed features are cheaper to run.

Talk to us

Send us the task, rough volume and the documents involved. We will give you an estimate range built with your own numbers, show the working, and tell you which model tier we would test first.

Prefer to talk it through? Pick a time on our calendar, message us on WhatsApp or write to hello@astrafolio.com. Replies come within 12 hours, Monday to Saturday between 09:00 and 21:00 IST.

Frequently asked questions

Is the ChatGPT subscription the same as the API?

No. A chat subscription is a separate product with its own plan. The API is billed by usage, per token, and is what a business app uses behind the scenes. Check each provider's pricing page for how each is charged.

Can the bill suddenly jump?

Yes, if usage jumps or a bug sends repeated requests. That is why we set spending limits in the provider's console and log usage per feature. A limit turns a surprise into an alert.

Do I pay more for longer answers?

Yes. Output tokens are billed, usually at a higher rate than input. Asking for short, structured answers lowers cost and is often easier to check as well.

Is a free tier enough for a business app?

Free tiers are meant for testing and often come with limits on usage and on how your data may be used. Read the terms on the provider's page before sending customer data to one.

Should I pick the cheapest model?

Pick the cheapest one that passes your own test on real cases. A cheap model that gets one in ten answers wrong can cost more in review time than a better model costs in fees.

Written byAstrafolio Team, senior web, SEO and AI specialists in Noida, India.

Next step

Want this working in your business?

A 30-minute call is enough for us to tell you what would move the needle first, what it costs and how long it takes.

Book a discovery call

More reading

You may also like

AI Automation8 min read

AI Receptionist for a Small Business: What to Expect

An AI receptionist for small business answers calls and chats, takes messages and books slots. See what it handles, what stays human and how to test one.

Read
AI Automation8 min read

Build vs Buy AI: How to Decide for a Small Business

Build vs buy AI: six questions tell you whether to buy a tool, connect one with automation or build custom. Includes a decision grid and a route table.

Read
AI AutomationIndia8 min read

WhatsApp Chatbot Cost in India: What You Pay (2026)

WhatsApp chatbot cost in India is four bills: the bot build, Meta's per-message fees, a provider fee and tuning. See each one and a worked monthly formula.

Read

Free audit

Get a free 10-point website and SEO audit

Send us your website address. We go through it point by point and send you what we find, in plain words, within 2 working days. No obligation.

Contact

Drop us a note

Tell us what you are building and what success looks like. A real person replies within 12 hours with next steps, not an automated sequence.

Prefer to talk first?

Pick a 30-minute slot in your time zone. No preparation needed.

Book a discovery call
What do you need? (tap any)

We need an email or a WhatsApp number, at least one.

Or message us on WhatsApp

Takes under a minute. A real person replies within 12 hours, and we only use your details to reply. Privacy policy