Adding AI features to an existing product without blowing the budget

How to add AI to a live product: pick one job, measure with an eval, cap spend per user, cache, route cheaply, and handle privacy and disclosure.

The short answer

Pick one narrow job, build a small test set before you build the feature, and measure quality and cost per request from the first day. Control spend with per-user limits, caching, shorter inputs and a cheaper model where it is good enough. Tell users when they are talking to AI, and keep personal data out of prompts unless you have a basis for sending it.

On this page
  1. Which job should the AI do?
  2. How do you test an AI feature?
  3. How do you keep the cost under control?
  4. How do you build it so it does not break the product?
  5. What about privacy and law?
  6. What does a sensible first project look like?
  7. What are the early warning signs of a runaway bill?
  8. Working with us

Adding AI to a live product is easy to demo and easy to overspend on. The risk is rarely that the model fails completely. It is that the feature is slightly unreliable, costs more per user than the user pays, and nobody measured either.

Which job should the AI do?

Start with one narrow job where a wrong answer is cheap and a right one saves real time:

  • summarizing a long record;
  • drafting a reply a person reviews;
  • classifying or tagging incoming items;
  • extracting fields from text;
  • searching your own documents.

Avoid, at first, anything where a wrong answer moves money, deletes data or sends something to a customer without review.

Write the job in one sentence with a measurable success: “classify support emails into six categories with agreement of at least X percent with a human”. If you cannot write the test, you cannot know whether it works.

How do you test an AI feature?

Build the evaluation before the feature, and keep it as you change things.

  • Collect real cases from your product first (with the right privacy permission), then bug reports, then hand-written ones.
  • Keep a held-out set that you never tune on.
  • Use the cheapest grader that fits: exact match or a script before a model acting as judge.
  • Run each case several times, because outputs vary; a gain inside the noise is not a gain.
  • Never paste a failing test case into the prompt to make it pass.

Re-run the evaluation whenever you change the prompt, the model or the settings, and compare before and after. Evals do not belong in your normal CI run; run them when the AI part changes.

How do you keep the cost under control?

Model prices change, so look up current pricing from your provider and calculate from tokens, not guesses. Then use these levers, roughly in order of effect:

  1. Send less. Trim inputs to what the task needs. Long context costs money on every request.
  2. Cache. Cache identical requests, and use the provider’s prompt caching for large repeated prefixes such as instructions or documents.
  3. Route by difficulty. A smaller, cheaper model often does classification and extraction as well as a large one. Test it with your eval, and use the larger model only for the hard cases.
  4. Cap output. Set a maximum length.
  5. Batch. Work that is not urgent can run in the background, sometimes at a lower price through a batch interface.
  6. Limit per user and per account. A quota stops one heavy user from costing more than they pay. Store counts in the database so every server sees them; see designing a SaaS that can move servers.
  7. Alert on spend, by day and by account, from the first week.

Log tokens in and out and cost per request. Then you can answer “what does one active user cost per month?” with a number.

How do you build it so it does not break the product?

  • Make it optional and separate. If the AI provider is down, the rest of the app still works. Set timeouts and handle errors; see your SaaS keeps going down.
  • Run slow calls in a background job, not in the web request.
  • Validate outputs. Ask for structured output, check it against a schema, and retry or fall back when it fails.
  • Keep a human in the loop for anything consequential.
  • Make it safe to run twice. Retries must not charge or send twice.
  • Treat model output as untrusted input. Never run it as code or put it in a page unescaped.
  • Guard against prompt injection. If the model reads user content or web pages, it can be told to do things. Give it only the tools and data it needs, and check permissions on the server for any action it triggers.

What about privacy and law?

  • Personal data in prompts is processing that needs a legal basis and a provider agreement. Minimize what you send, strip what you can, and check the provider’s data terms, including whether they use your data for training.
  • Disclosure. If you serve users in the EU, the AI Act’s Article 50 requires that people are told when they are interacting with an AI system, unless it is obvious. The Commission’s page says these obligations apply from 2 August 2026, and guidance is still being developed, so check the current text. This is not legal advice.
  • Keep an audit trail of what the AI was given and what it produced, with limited retention.

What does a sensible first project look like?

  1. One job, one success measure.
  2. An eval of a few dozen real cases.
  3. A prototype on a mid-priced model.
  4. Try a cheaper model against the eval.
  5. Ship to a small group with quotas and a spend alert.
  6. Review cost and quality weekly for a month.

What are the early warning signs of a runaway bill?

A prompt that grows with each turn of a conversation because the whole history is resent. A background job that retries failed calls without a limit. One account that uses far more than the rest. A feature that calls the model on every page view instead of once per change. Each is visible in the per-request logs of tokens and cost, which is why you log them from the start, and each has a simple fix: summarize the history, cap the retries, add a quota, or cache the result.

Working with us

We add AI features to existing products with an evaluation first, spend limits and fallbacks, and we do not ship a feature we cannot measure. Describe the job you want done and what data it touches via contact, or see our web application work.

Keep reading

Tell us what you want to build.

A product, a website, a search problem or a system that should work better. We reply with a plain answer and the first step.

A few sentences are enough (at least 20 characters).

We use your details only to answer your inquiry. See our privacy policy.