How to Add AI to an iPhone App Without an API Key (2026)

Add AI features to an iPhone app without an API key: summaries, suggestions, sorting and pictures, Apple's consent rule, costs, and the steps in Borel.

By Sigsten Gustavii· · 8 min read

To add AI to an iPhone app, pick one task where AI saves the person real effort, write the instruction the model follows, send the person's input to a model from the app through a server that holds the key, ask for consent before the opening request, and handle failures in plain words. With Borel you describe the feature and it does the rest.

Three ways to add AI to an iPhone app
RouteWhat you set upWhere the key livesMain risk
Call an AI company's API from the appAn account and an API keyInside the appThe key can be extracted and used on your bill
Your own server in betweenAn account, a key and a serverOn your serverA server to build, secure and pay for
Borel AINothingOn Borel's server; no key at allCosts come from your app's balance

Adding AI used to mean an afternoon of sign-ups and an evening of worrying about a key. Anything inside an iPhone app can be pulled out of it, so a key in the code is a key on the internet. The usual fix is a server of your own that holds the key and forwards requests. Borel apps get that server built in.

AI features that make an app better

The useful AI features in everyday apps are rarely chatbots. They are small helpers that save a minute:

AI features people actually use, by kind of app
FeatureExample appWhat the AI does
SummariseA journal or notes appTurns a week of entries into three lines
SuggestA meal plannerProposes five dinners from what's in the fridge
Sort and tagA budget or reading appPuts an expense or a book in the right category
RewriteA messaging or listing appMakes a description shorter, friendlier or clearer
ExplainA study appExplains a wrong answer in simple words
Make picturesA kids' story or greeting card appDraws a picture from a description
ChatA coach or tutor appAnswers questions in a role you define

If the chat is the whole app, read how to make an AI chatbot app. This guide is about adding AI to any app.

Cloud AI or on-device AI?

There are two places a model can run. Cloud models are larger and better at writing and reasoning, and each request costs a little. On-device models run on the iPhone itself, for free and offline, but are smaller. Apple ships an on-device model to developers through its Foundation Models framework on iOS 26 and recent iPhones.

Borel apps are built for iOS 17 and up, so they reach as many iPhones as possible, and they use cloud models through Borel AI. Apple's own on-device tools still work in them where they fit: text recognition in photos and speech to text, for example, run on the phone with Apple's Vision and Speech frameworks. See voice and speech to text.

Writing the instruction the model follows

Every AI feature is a short instruction plus the person's input. The instruction does most of the work:

  • Say the job in one line. "Summarise these journal entries in three short sentences."
  • Say the shape of the answer. "Return one category from this list: food, transport, home, fun, other."
  • Say what not to do. "Don't give medical advice. Don't invent facts."
  • Give the voice. "Warm, plain words, no emojis."

Answers that feed into the app, like a category, should come from a fixed list, so the app can check them. Ask Borel for that and it will make the model choose from the list and handle an odd answer.

Apple's rule: ask before data goes to an AI

Apple's Guideline 5.1.2(i) says apps must clearly disclose where personal data will be shared with third parties, including with third-party AI, and get explicit permission before doing so. In a Borel app, the AI kit handles this. Before the opening request of each kind, it asks the person whether what they send may go to the AI, naming the company that makes the model, and remembers the answer. An AI switch in settings lets them change their mind, and after a "Don't Allow" the app explains rather than failing silently.

Write the rest of your privacy answers in App Store Connect honestly: say that text or photos are sent to an AI service to produce the feature. The privacy policy Borel hosts for the app covers its AI use.

When the AI is wrong, slow or offline

AI features fail in ways ordinary buttons don't, so plan for it:

  • Slow. A cloud answer can take several seconds. Show a clear "Thinking…" state and keep the rest of the screen usable.
  • Offline. Without a connection there is no answer. Say so in one sentence and let people try again.
  • Wrong. Models sometimes invent things. Let people edit or discard what the AI wrote, and never save it without them seeing it.
  • Refused consent. Someone may say no to AI. The rest of the app should still work.
  • Empty balance. When your app's balance runs out, the AI stops. Watch Cloud cost and top up before it does.

Borel's AI kit returns a plain sentence for each failure, which the app shows instead of a technical error.

Choosing a model

Borel AI has a default model that is quick and inexpensive, and a catalogue with models from Alibaba, OpenAI, Meta, Google and Anthropic. Start with the default. If the answers aren't good enough for your feature, ask Borel to use a larger model for that one feature; long writing and careful reasoning benefit most. Keep sorting and tagging on a small model, where speed matters more.

What AI costs in an app

Costs of adding AI to an iPhone app with Borel
ItemCostNotes
Building the featureCredits, from 5 credits a dayPro from $20 a month for more
Each AI answerPer request, from your app's balanceDepends on the model and the length
Each picturePer picture, from your app's balanceThe same words return the same picture at no new cost
PublishingPro plus $99 a year to AppleNeeded for the App Store

Borel meters every AI call against your app's balance, which you top up in dollars, and shows what each app uses in Cloud cost. When the balance reaches zero, the AI stops instead of running up a bill. If an AI feature is the reason people use your app, charge for it with a subscription through Apple's in-app purchase, and give a small free allowance. See pricing and credits.

How to choose the right way to add AI

  • Borel, if you want AI in a native iPhone app with no key, consent handled, and costs metered per app.
  • Your own server with an AI company's API, if you need a specific model setup, fine-tuning or your own data pipeline, and can run a server.
  • Apple's on-device model, if you are writing Swift by hand in Xcode and only target recent iPhones.
  • [Lovable](/compare/lovable), if your AI feature lives in a web app rather than on the iPhone.

How to do it with Borel, step by step

Step 1: Pick the feature

Choose one task from the table above that saves the people using your app a minute, and write down what goes in and what should come out.

Step 2: Describe it in your app's chat

A message to an existing app
Add a Weekly summary button to the journal screen. It sends the last 7 entries to the AI with this instruction: summarise them in three short, kind sentences, mention one thing that went well, and never give medical advice. Show the summary in a card above the entries, with a Copy button. If AI is turned off in settings, explain how to turn it on.

Rivet adds the feature with Borel's AI kit: the call, the consent question before the opening request, the AI switch in settings and the error messages. No key is created or pasted.

Step 3: Try it on a live iPhone

In the iOS Simulator in your browser, add a few entries and press the button. Accept the consent question and read the answer. Then turn AI off in settings and check the app explains.

Step 4: Tune the instruction

Change the instruction in plain words until the answers fit: "shorter", "use the person's name", "never more than 40 words". Try a larger model if needed.

Step 5: Publish

Stamp checks the app, including that AI consent is in place, and Publish builds, signs and uploads it under your Apple Developer account. Top up the app's balance before you tell people about it.

The Bottom Line

AI in an app works when it does one small job well and respects the person's data. With Borel, you describe the feature, and the app gets Borel AI with no key, the consent Apple asks for, a choice of models and costs metered per app. Pick the minute you want to save the people using it, describe it in Borel, and try it on a live iPhone. More on built-in AI.

Questions people ask

Do I need an OpenAI or Anthropic API key to add AI to my app?

Not with Borel. Apps call Borel AI through Borel's server, which reaches the model makers, so no key is ever in your app or your account.

Is it safe to put an API key in an iPhone app?

No. Anything in an app can be extracted, so a key inside it can be used by anyone. Keys belong on a server; see API key.

Does Apple allow AI features in apps?

Yes, with consent: Guideline 5.1.2(i) requires telling people when personal data goes to a third-party AI and getting permission. Borel's AI kit asks for it before the opening request.

How much does AI cost in an app?

Each request costs a small amount that depends on the model and the length of the text. In a Borel app it comes from the app's balance, and the AI stops when the balance is empty.

Can my app make pictures with AI?

Yes. Borel AI makes pictures from a description, in square, portrait or landscape, and saves them in the app's files. The same words return the same picture without a new charge.

Can the AI run on the iPhone without internet?

Borel AI runs in the cloud, so it needs a connection. Apple's own on-device tools, like text recognition and speech to text, work offline in Borel apps.

Which AI model should I use?

Start with Borel's default and switch a single feature to a larger model only if its answers aren't good enough. See what an LLM is.

Can I add AI to an app I already built with Borel?

Yes. Describe the feature in the app's chat, and Borel adds it to the existing app as a new version you can roll back.

I started Borel because I wanted to make iPhone apps without a Mac or a team behind me. If this helped you build something, I would love to see it.

– Sigsten

Make your iPhone app in Borel

Describe the app you want and see its first screens before you pay anything.

See your app free

Keep reading