Shipping Gemini Pro in a mobile app: keys, routing and App Check

Ask three people what "put Gemini Pro in the app" means and you'll get three answers. In October 2026 the name covers a Pro tier of models in the Gemini API, the Google AI Pro subscription and the Gemini app itself. Only the API matters for a mobile build.
This guide is for mobile leads and CTOs adding an AI feature to an iOS, Android or Flutter app. The steps follow the order in which decisions get expensive to undo: model choice, key handling, App Check, speed, then data. Fixes for the usual problems are at the end.
Before you start
Settle these before you touch an SDK:
- A Firebase or Google Cloud project with billing turned on. The Pro-tier models have no free tier on Google's pricing page, and production data belongs on the paid tier anyway (step 7).
- A list of every AI feature you plan to ship, with the time a user will realistically wait for each one.
- Agreement on which Gemini model you mean. The names moved a lot this year.
Which Gemini Pro you're actually integrating
Gemini Pro is Google's name for its high-end Gemini models, and Gemini 3.1 Pro is the latest model carrying it. Google launched Gemini 3.1 Pro Preview on February 19, 2026 and shut down Gemini 3 Pro Preview on March 9.
Then Gemini 4 Argon reached general availability on October 13, 2026. Google calls it its frontier model for complex workflows. It doesn't carry the "Pro" label, but it's now the top model in the Gemini app for Google AI Pro subscribers. Google hasn't said whether Argon belongs to the Pro line.
If you already built on 3.1 Pro, it's still a capable option. Google DeepMind's model page lists a 1M-token input window, 64k output tokens, multimodal input and better agentic handling of multi-step tasks and coding. It's still a preview model, though, and that matters in step 8.
The lineup below comes from Google's models page and pricing page, checked October 23, 2026.
| Model | Status | Fits in a mobile app for | Paid price per 1M tokens (input / output) |
|---|---|---|---|
| Gemini 4 Argon | Stable | Hard reasoning, long documents, multi-step agents | $2 / $10 through Nov 30, 2026; $4 / $20 from Dec 1, 2026 |
| Gemini 3.1 Pro | Preview | Complex tasks you've already tested on it | $2 / $12 for prompts up to 200k tokens |
| Gemini 3.8 Flash | Stable | Most chat, extraction and summarization features | $0.75 / $3.75 through Dec 31, 2026 |
| Gemini 3.5 Flash-Lite | Stable | High-volume, low-latency tasks | $0.30 / $2.50 |
| Gemini Nano | On-device | Short rewrites, summaries and proofreading with no network call | Not on the API price list; runs on the user's device |
Read the price column as a latency column too. A Pro-tier call on every screen makes the app feel slow, and it shows up on the cloud bill as a line item someone will ask about.
The app, the API and the Google AI Pro plan
How to use Gemini Pro depends on who's asking. A person doing daily work signs in to the Gemini web or mobile app, and a Google AI Pro or Ultra plan opens up the Pro-tier models. No code involved.
Google's plan page puts AI Pro between Google AI Plus and Google AI Ultra. It includes Gemini 4 Argon in the Gemini app, expanded access to Gemini 3.1 Pro and Gemini Notebook, and Gemini in Gmail, Docs and Sheets. It also includes Deep Research, which Google says analyzes hundreds of sources to build a report.
None of that reaches your customers. A product team calls the Gemini API instead: prototype prompts in Google AI Studio, then call the model from a server or through Firebase AI Logic. Your users never need a Google AI plan.
1. Decide which features need a Gemini Pro model
Start with the feature list from your prerequisites. Rewriting a message, tagging a photo or summarizing a short note rarely needs Argon. Reasoning across a 60-page policy or planning a multi-step task might.
Route each job to the smallest model that passes your test set. In practice, a sensible default is Flash or Flash-Lite for most of the app, with a Pro-tier model behind one or two features.
The Gemini Pro features worth designing around, per the Gemini 4 Argon model card:
- Multimodal input. Argon accepts text, images, video, audio and PDF. A field technician can photograph a damaged part, or a customer can snap a receipt, and ask about it.
- A 1,048,576-token context window. Long policy manuals or a full product catalog fit in one request. Every token you send is billed, so use it on purpose.
- Function calling and structured outputs. The model returns a request to call one of your functions, or JSON that matches a schema. Your UI never has to parse free text.
- Grounding with Google Search and Google Maps. Answers can cite current web or location data instead of training data alone.
- Thinking levels. Argon supports low, medium and high. Lower levels answer faster and cost less.
- Code execution, URL context and file search. Useful in analytics or document-heavy apps. Most consumer apps can skip them.
The model card also lists what Argon doesn't do: no Live API, no image generation and no audio generation. Real-time voice needs one of Google's separate Live models, such as Gemini 3.8 Live. Image generation and editing go to the Nano Banana models.
Some features shouldn't get a Pro model at all. A smart reply or a two-line summary runs faster on Flash-Lite or Gemini Nano. Where a wrong answer causes harm, such as a dosage, a credit decision or legal advice, no model should make the final call. Use it to draft or retrieve, and keep a qualified person in the loop. And if nobody on the team can name the user problem a feature solves, park it until they can.
2. Keep the API key out of the app binary
Google's API key guidance leaves no room: "Do not hardcode API keys directly in web or mobile apps." Anyone with a decompiler can pull a key from client code. You have two safe patterns.
Firebase AI Logic has client SDKs for Swift on Apple platforms, Kotlin and Java on Android, JavaScript on the web, Dart for Flutter, and Unity. A Firebase proxy holds the key, so per the Firebase AI Logic docs, "your Gemini API key stays on the server."
Your own backend proxy means the app calls your API and your server calls Gemini. Pick this when your stack isn't on the SDK list, or when you need to add business data to the prompt before it leaves.
If the app still uses Google's older client SDKs for Android, Swift, Dart or web, schedule the move. They're deprecated in favor of Firebase AI Logic.
3. Turn on App Check before November 2, 2026
App Check confirms a request came from your real app on an untampered device. Firebase supports Play Integrity on Android, App Attest or DeviceCheck on Apple platforms, and reCAPTCHA Enterprise on the web.
This step has a hard date. Firebase states that "starting November 2, 2026, Firebase App Check enforcement will be required to use Firebase AI Logic."
For expensive Pro-tier calls, consider replay protection too. It issues limited-use tokens that work once, which blocks scripted reuse at the cost of a little latency per request.
Firebase AI Logic also applies per-user rate limits by default. Tune them to real usage so one bad actor can't drain a month's budget overnight.
4. Pick the API provider
Firebase AI Logic supports two providers. The Gemini Developer API has a free tier and gets a prototype running fastest. The Agent Platform Gemini API (formerly Vertex AI) runs inside Google Cloud, which suits teams that need Google Cloud controls, regions and billing.
You aren't locked in. Switching means enabling the other API and changing the initialization code.
5. Make the response feel fast
Users judge speed by when the first words appear, not by total response time.
- Stream responses. Google's text generation guide notes that by default the model replies only after it finishes generating. Streaming shows chunks as they arrive.
- Lower the thinking level where deep reasoning isn't needed. Thinking settings trade cost and latency against intelligence.
- Reuse context. Argon supports implicit caching, which can cut the cost of repeated prompt prefixes like a long system prompt.
- Go on-device for small jobs. Gemini Nano runs in Android's AICore service and works offline. The Firebase AI Logic hybrid API can try Nano first and fall back to a cloud Flash or Pro model.
- Keep the model name in Remote Config. You can then change models without shipping an app release.
On-device has firm limits, so design around them early. Firebase's Android hybrid inference is labeled experimental. It runs only in the foreground, caps requests at 4,000 tokens and handles single-turn text without tools. That rules out back-and-forth chat. On the web, it works only in Chrome on desktop.
6. Let the model ask and your server decide
Function calling is where a mobile assistant gets useful, and where it can do real damage. Google's function calling guide is clear that "the model doesn't execute the function itself." Your code does, so treat every call as a request.
Check the user's permissions on the server before running anything. Ask the user to confirm any action that moves money, sends a message or changes a record.
Keep system prompts and business rules server-side as well. A system prompt shipped inside the app is as easy to read as an API key.
7. Send less data, and only on the paid tier
The Gemini API terms split free and paid use sharply. On unpaid services, Google may use your content to improve its products. The terms add that "human reviewers may read, annotate, and process your API input and output." On paid services, Google says it doesn't use prompts or responses for that. It logs them for a limited period to detect policy violations.
That gives you three rules for any app with real users:
- Run production on the paid tier. Keep the free tier for prototypes with test data.
- Know where your users are. The terms allow only paid services when the app serves users in the European Economic Area, Switzerland or the UK.
- Strip what the feature doesn't need. Remove names, account numbers and health details on your server before the prompt goes out. US state privacy laws such as the CCPA still apply to what you collect.
8. Pin a stable model and keep testing
Google recommends that most production apps use a specific stable model. Its models page warns that preview models can be deprecated with as little as 2 weeks' notice. Gemini 3 Pro Preview went that way in March 2026, and its model ID now points to 3.1 Pro Preview.
Before launch, collect 50–100 real user requests as a test set. Rerun it whenever the model, prompt or thinking level changes. In production, watch time to first token, error rate, cost per active user and how often people retry or rephrase.
If you want help on this build, our AI and machine learning services team would start with the routing map from step 1 and the test set from this step.
Gemini integrations for data in your business apps
Your mobile app is one route. When staff want Gemini to answer questions over company data, there are three others, and each depends on where the data lives.
Google Workspace data in the Gemini app. Google's admin help says the Google apps setting "is on by default" for Workspace accounts. Users can connect Gmail, Google Drive, Google Calendar, Docs, Google Keep and Google Tasks. Admins can turn it off for an organizational unit or group.
Personal accounts. Google's Personal Intelligence beta connects Gmail, Google Photos, YouTube and Search. Those connections are off by default. It launched in the US for eligible AI Pro and AI Ultra subscribers and isn't available to Workspace business, enterprise or education users.
Third-party business systems. Gemini Enterprise uses connectors, and Google's documentation lists sources including Microsoft SharePoint, OneDrive, Outlook, Jira Cloud, Confluence Cloud and ServiceNow. Federation reads from the source at query time, so nothing is copied. Search quality may be lower, though, and your query string goes to every enabled third-party backend. Ingestion copies data into the Gemini Enterprise index, which improves search but adds storage and sync time. Access maps through identity syncs, so test permissions with real accounts before rollout.
Data in your ERP, CRM or order system is out of the Gemini app's reach. Your own app can get to it through the pattern in step 6. The model asks for "order status for order 4471," your backend checks permissions and returns that one record, and the model never touches the database.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The first words take seconds to appear | No streaming, a high thinking level, or a Pro-tier model on a simple job | Stream, lower the thinking level, route the feature to Flash or Flash-Lite |
| The bill jumps overnight | Loose rate limits, an extracted key, or Pro-tier calls on every screen | Tighten per-user limits, enforce App Check, move the key server-side, revisit routing |
| Firebase AI Logic calls fail from November 2, 2026 | App Check isn't set up, and enforcement is now required | Register Play Integrity, App Attest or DeviceCheck, and reCAPTCHA Enterprise for web |
| A model ID errors out or answers differently | A preview model was retired or now points to a newer model | Pin a stable model and keep its name in Remote Config |
| The on-device path never runs | Hybrid inference is experimental, foreground-only, single-turn and capped at 4,000 tokens | Keep the request small, or let it fall back to a cloud model |
| Deprecation warnings in the build | The app still uses Google's older client SDKs | Migrate to Firebase AI Logic |
| Staff say Gemini can't see company data | The data sits in a system the Gemini app can't reach | Use Gemini Enterprise connectors, or function calling through your backend |
Building in React Native instead? The cross-platform side is covered in adding AI to a React Native app.
FAQ
Is the Gemini API still free?
Partly. Google's pricing page lists a free tier for models such as Gemini 3.8 Flash and Gemini 3.5 Flash-Lite, but not for Gemini 4 Argon or Gemini 3.1 Pro. Free-tier content can be used to improve Google's products, so keep it to prototypes and test data.
Is Gemini Pro as good as ChatGPT?
It depends on the job, so test both on your own prompts. For mobile teams, the practical differences often sit outside the model. Gemini comes with Firebase client SDKs, App Check and on-device Gemini Nano on supported Android devices.
How much does it cost to run Gemini Pro in a mobile app?
Cost follows tokens, not users. Gemini 4 Argon costs $2 per 1M input tokens and $10 per 1M output tokens through November 30, 2026, then doubles to $4 and $20. Routing simple features to Flash or Flash-Lite is the biggest cost lever you control.
Next step
Most of the work here happens before the first prompt: deciding which three requests deserve a Pro model and how the rest stay quick and private. If you're planning that for an iOS, Android or Flutter app, our mobile app development team can map the routing and the proxy with you. Talk to us about your app.
Related reading
Working from Singapore or Thailand? Explore Mobile App Development Company Singapore and Mobile App Development in Thailand.