How to add AI features to your existing app
Last reviewed 2 December 2026
Most AI features in apps are a request to a model run by OpenAI, Anthropic or Google, or a smaller model on the phone itself. Connecting the model is the easy part. Your users’ data, the API key and the store rules are where the work is.
Choose one task the AI should take off your users’ hands, then decide whether it runs on a cloud model from OpenAI, Anthropic or Google or on the phone. Send cloud requests from your server, never with the API key in the app. Ask before personal data goes to a third-party AI, add reporting if it generates content, and set a usage budget.
Rather talk it through with someone? Tell us your AI idea →
Start with one feature
“Add AI” isn’t a feature. Pick one task your users do often that a model can take off their hands, and judge it on three questions: what time does it save them, what data does it need, and what happens when it gets something wrong? The features founders ask us for most:
- A chat assistant that answers questions about your product or the user’s own records.
- Photo and document scanning: reading receipts, forms or ID documents into fields.
- Smart search that finds things by meaning, not exact words.
- Summaries of long notes, messages or reports.
Where the AI runs
| Option | Good for | Trade-off |
|---|---|---|
| A cloud model API from OpenAI, Anthropic or Google (Gemini) | Chat, writing, reasoning over documents | Data leaves the phone, each request is billed, and the call has to go through your server |
| On the phone: Apple’s Foundation Models framework, Google’s ML Kit and Gemini Nano | Summaries, text extraction, scanning, working offline | Only on supported devices, and smaller models |
| Search over your own data with vector search, for example pgvector in Supabase | Smart search and answers grounded in your content | Your data needs preparing and keeping up to date |
- Apple: the Foundation Models framework (opens in a new tab) gives access to the models behind Apple Intelligence. Apple says on-device models “excel at a diverse range of text generation tasks, like summarization, entity extraction, text and image understanding”, and that “people need a device that supports Apple Intelligence”.
- Google: ML Kit (opens in a new tab) says its “processing happens on-device” and works offline. Its document scanner runs the whole flow on the device, and its GenAI APIs use Gemini Nano on a list of supported Android devices.
- Smart search: Supabase describes pgvector as “a Postgres extension for vector similarity search”, and semantic search as search that “interprets the meaning behind user queries rather than exact keywords” (Supabase (opens in a new tab)).
Keep the API key on your server
Every cloud provider says the same thing. OpenAI: “Never deploy your key in client-side environments like browsers or mobile apps”, and it warns a leaked key can lead to unexpected charges (OpenAI (opens in a new tab)). Google: “Never expose keys client-side in production”, and use a backend proxy instead (Gemini (opens in a new tab)). Anthropic: never include the key directly in your code (Anthropic (opens in a new tab)).
In practice the app calls your server, and your server calls the model. That’s also where you check who the user is, limit how often they can ask, and stop one account running up the bill. In apps built with Lovable or Bolt, anything in a VITE_ variable reaches every visitor’s browser, so the key belongs in a backend function. Our security checklist shows how to check.
What happens to your users’ data
- OpenAI: data sent to its API “is not used to train or improve OpenAI models (unless you explicitly opt in”, and abuse-monitoring logs are kept for up to 30 days (OpenAI (opens in a new tab)).
- Anthropic: by default it does “not use your inputs or outputs from our commercial products”, which include its API, to train its models (Anthropic (opens in a new tab)).
- Google Gemini: on the paid tier Google doesn’t use your prompts or responses to improve its products. For the free tier it says: “Do not submit sensitive, confidential, or personal information to the Unpaid Services” (Gemini API terms (opens in a new tab)). Use a paid project for real users’ data.
Then update your privacy policy to name the AI provider, and check that your App Store privacy details and Google Play Data safety form still match what the app sends.
What Apple and Google require
- Ask before sharing personal data with an AI provider. Apple’s Guideline 5.1.2(i): “You must clearly disclose where personal data will be shared with third parties, including with third-party AI, and obtain explicit permission before doing so.”
- Moderate what the AI generates. Apple’s Guideline 1.2 covers “social media, user-generated content platforms, and AI content creation apps”, which need filtering, reporting, blocking and published contact details. See our Guideline 1.2 guide.
- Let users report AI output on Android. Google Play says “Apps that generate content using AI must contain in-app user reporting or flagging features” (AI-Generated Content policy (opens in a new tab)). Google lists chatbot apps where the chat is “a central feature of the app” as in scope, and says productivity apps that use AI to improve an existing feature, such as suggested email drafts, aren’t covered at this time (Google Play (opens in a new tab)).
What it costs to run
Cloud models are billed by usage, not by month. OpenAI, Anthropic and Google all publish prices per million tokens, with input (what you send) and output (what the model writes) priced separately. So the bill grows with the number of users, how often they ask and how much text each request carries. Long chat histories and whole documents sent with every request add up fastest.
- Start with the smallest model that does the task well, and test a bigger one only where it clearly helps.
- Cap requests per user per day on your server, and set a spending limit with the provider.
- Send only the text the model needs, not the whole record.
- Use on-device models for simple tasks, so those requests don’t reach a paid API at all.
For the rest of your running costs, see app maintenance costs.
Plan for wrong answers
Models are sometimes confidently wrong. Show where an answer came from when you can, let people edit what the AI filled in before it’s saved, and keep a person in charge of anything with consequences, such as money, health or legal decisions. Test the feature with your real data and real users before you switch it on for everyone.
Questions founders ask
Which AI model should we use?
The one that does your single task well at a cost you can carry. OpenAI, Anthropic and Google all bill per token, and by default none of them train on API data, except Gemini’s free tier, which you shouldn’t use for personal data. For simple text tasks on iPhone, Apple’s on-device models may be enough.
Do we have to tell users the app uses AI?
If personal data goes to a third-party AI, yes: Apple’s Guideline 5.1.2(i) requires you to disclose it and get explicit permission first. If the AI generates content, Apple’s Guideline 1.2 and Google Play’s AI-Generated Content policy also expect ways to report it.
Will adding AI get our app rejected?
Not on its own. Rejections come from what’s around it: no permission before sending personal data to an AI provider, no way to report what the AI generates, or a feature the reviewer can’t try.
Can we add AI to an app built with Lovable or Bolt?
Yes. The same rules apply: keep the API key in a backend function, never in a VITE_ variable, and limit how often each user can call it.