To build an AI app with Flutter in 2026, most teams call Google’s Gemini models through Firebase AI Logic (the firebase_ai package), add ready made chat widgets from the Flutter AI Toolkit, and run small models on the phone with flutter_gemma when privacy or offline use matters. For a typical chat feature, the running cost is a few cents per active user per month on Gemini’s cheaper models.
This guide covers which parts of that stack are production ready, what changed this autumn, how to choose between cloud and on device AI, and what the monthly bill actually looks like with today’s published prices. It is written for founders, product owners and engineering leads who need to make a build decision, not just get a demo running. If you want a team to scope it with you,
Our Flutter app development company builds AI features into Flutter apps for iOS, Android and web.
How we checked this guide: every price, package name and deadline below was checked against Google’s official Gemini, Firebase and Flutter documentation on October 9, 2026. Model prices change often, so confirm current rates on the official Gemini Developer API pricing page before you budget.
What Changed For Flutter AI Apps In Late 2026
Many tutorials that rank today were written in 2024 or early 2025 and now point to package names, model names and security setups that no longer apply. Four changes matter for anything you build now.
- Firebase AI Logic replaced “Vertex AI in Firebase”. The Flutter plugin is firebase_ai. It lets you choose between two providers: the Gemini Developer API (which has a free tier) and the Agent Platform Gemini API, which Google previously called Vertex AI.
- Gemini 2.5 models are being retired. Firebase states that Gemini 2.5 models on the Agent Platform Gemini API shut down for all projects in October 2026, and recommends moving to the Gemini 3.x family. Code samples that still reference 2.0 or 2.5 Flash need updating.
- App Check becomes mandatory on November 2, 2026. Firebase now requires App Check enforcement to use Firebase AI Logic from that date. App Check is the layer that proves a request comes from your real app, not from someone who copied your configuration.
- Gemini 3.8 Flash pricing doubles on January 1, 2027. Google currently lists Gemini 3.8 Flash at a reduced introductory rate through December 31, 2026. Budget for the January price, not the launch price.
The Three Ways To Add AI To A Flutter App
Every Flutter AI feature uses one of three architectures, or a mix of them. The choice decides your cost model, your privacy story and how much backend work you need.
1. Cloud Models Called Through Firebase AI Logic
The Flutter app sends prompts to Gemini through Firebase’s proxy service. Your Gemini API key stays on Google’s servers instead of being shipped inside the app, App Check blocks unauthorized clients, and per user rate limits are switched on by default. According to the Firebase AI Logic documentation, the client SDKs support text, chat, images, PDFs, audio, video, structured JSON output, function calling, grounding with Google Search or Google Maps, and real time voice through the Live API.
This is the fastest route to production for most apps because you do not need to run your own server for AI calls.
2. Your Own Backend For OpenAI, Claude Or Other Providers
If your product needs a model from another provider, such as OpenAI for a ChatGPT style integration, the Flutter app should call your own backend (for example Cloud Functions or a small API service), and that backend calls the provider. Firebase AI Logic only proxies Gemini, so it cannot hide an OpenAI key for you. Never put a provider API key inside a Flutter build: anyone can extract it from the app binary and run up your bill.
A backend also gives you one place to switch models, log usage, apply your own rate limits and add retrieval augmented generation (RAG), where the model answers from your own documents.
3. On Device Models
The model runs on the phone itself. There is no per request fee, it works offline, and user data never leaves the device. The trade offs are model quality, app size and device coverage. Google’s own LiteRT LM documentation points Flutter developers to the community maintained flutter_gemma package, which runs Gemma models and other small language models on Android, iOS and desktop.
The Flutter AI Stack, Layer By Layer
Here is what each piece does and how mature it is today. Google keeps an overview of these tools on the Flutter “Create with AI” page.
Firebase AI Logic (firebase_ai)
The core SDK for Gemini in Flutter. It covers the request types listed above, and Firebase lets you change the model name remotely through Remote Config or server prompt templates, so you can move to a newer or cheaper model without shipping an app update. That matters more than it sounds, given how often Gemini model versions now change.
One gap to know about: Firebase documents hybrid inference (use the on device model when available, fall back to the cloud) for its native Apple, Android and web SDKs. At the time of writing, its hybrid guides do not cover Flutter, so Flutter teams build that fallback logic themselves.
Flutter AI Toolkit
A set of chat widgets, including a full chat view with streaming responses, so you do not hand build a chat interface. It ships with a Firebase AI provider. Since version 0.9 it no longer accepts a raw Gemini API key when used with firebase_ai and always requires a Firebase project, which pushes teams toward the secure setup by default. It is the quickest way to add an assistant screen to an existing app.
GenUI SDK For Flutter
GenUI lets the model respond with real interface elements instead of a wall of text. You give it a catalog of your own widgets, and the model composes screens from them, such as a product carousel or a booking form with date pickers, using a JSON format built on the A2UI protocol. User interactions are fed back to the model. It is promising for assistants and agent style apps, but the API is still early and has changed between releases, so treat it as something to prototype with rather than build a core flow on today.
flutter_gemma And LiteRT For On Device AI
flutter_gemma runs models in the LiteRT LM format (LiteRT is the new name for TensorFlow Lite) on Android, iOS and desktop, with early web support. Recent versions add an opt in module that uses the models built into the operating system, Gemini Nano on supported Android devices and Apple Foundation Models on iOS 26 and later, so you do not have to bundle model weights at all. If you bundle your own model, plan for large downloads: some multimodal Gemma models listed in the package documentation need several gigabytes.
For classic machine learning tasks such as text recognition, barcode scanning or image labeling, Google’s ML Kit remains a lighter choice than a language model.
Cloud Or On Device: How To Decide
Use these rules of thumb rather than a feature checklist.
- Choose cloud Gemini when answers need strong reasoning, long documents, current information from Google Search, image generation or voice. Cloud models are far more capable, and setup is measured in days.
- Choose on device when data is sensitive (health notes, personal journals, internal documents), users are often offline, or the feature runs so frequently that per request fees would add up, such as autocomplete or on screen text classification.
- Choose hybrid when you need privacy or offline support for simple tasks but quality for harder ones. A common pattern: summarize and classify on device, send complex questions to the cloud with the user’s permission.
- Avoid on device as your only path when your users are mostly on older or low memory phones. Built in OS models only exist on recent devices, and bundled models increase download size and memory use.
What It Really Costs To Run AI In A Flutter App
AI features have two costs: the one time build, and the ongoing usage bill. Most guides only mention the first. Here is the second, using Google’s published prices.
Firebase AI Logic itself is free to use. You pay for Gemini usage, and paid tiers require your Firebase project to be on the Blaze pay as you go plan.
Current Gemini Prices That Matter For Mobile Apps
Standard paid tier prices per one million tokens, as listed on Google’s pricing page on October 9, 2026 (a token is roughly three quarters of an English word):
- Gemini 3.1 Flash Lite: $0.25 input and $1.50 output. Good for classification, short answers, translation and high volume tasks.
- Gemini 3.8 Flash: $0.75 input and $3.75 output through December 31, 2026, then $1.50 and $7.50 from January 1, 2027. A strong default for chat assistants.
- Gemini 3.1 Pro Preview: $2.00 input and $12.00 output for prompts up to 200,000 tokens. Use it only for features that genuinely need deep reasoning.
- Batch processing: 50 percent off standard rates for work that does not need an instant answer, such as overnight summaries.
- Grounding with Google Search: 5,000 free search requests per month shared across Gemini 3.x models, then $14 per 1,000.
Two details catch teams out. First, “thinking” tokens on reasoning models are billed as output tokens. Second, on the free tier Google states that content may be used to improve its products, while paid tier content is not. For any app handling customer data, that alone is a reason to move to a paid tier before launch.
A Worked Example: An AI Assistant With 10,000 Monthly Users
Assumptions: 10,000 monthly active users, each sending 30 messages a month. Each message carries about 1,500 input tokens (system instructions plus recent chat history plus the question) and returns about 400 output tokens. That totals 450 million input tokens and 120 million output tokens a month.
- Gemini 3.1 Flash Lite: about $293 per month, or roughly 3 cents per user.
- Gemini 3.8 Flash at the 2026 rate: about $788 per month, or roughly 8 cents per user.
- Gemini 3.8 Flash at the January 2027 rate: about $1,575 per month, or roughly 16 cents per user.
- Gemini 3.1 Pro Preview: about $2,340 per month, or roughly 23 cents per user.
The same assistant can cost eight times more depending on the model, before any optimization. If your app charges a subscription, model choice is a pricing decision, not just a technical one. An on device model would bring the per message fee to zero, at the cost of answer quality and device coverage.
Costs People Forget
- Chat history growth. Every message resends the conversation so far, so long chats cost far more per message than short ones. Trim or summarize history.
- Images and audio. Multimodal input is billed in tokens too, and audio input is priced higher than text on several models.
- Google states that most projects need to prepay after linking a billing account for the Gemini Developer API. The $300 Google Cloud trial credit cannot be used for Gemini Developer API costs, although it can be used with the Agent Platform Gemini API.
- Supporting services. Authentication, databases, storage and monitoring beyond Firebase’s free usage levels add their own costs.
Six Ways To Cut The Monthly Bill
- Route each task to the cheapest model that handles it well, and reserve Pro models for the few features that need them.
- Set a maximum output length and a sensible thinking level in the model configuration.
- Keep system instructions short and cap how much chat history you resend.
- Use context caching when many requests share the same long instructions or documents.
- Move anything that is not interactive to batch processing at half price.
- Turn on budget alerts and spend caps in Google Cloud before launch, and watch token usage in Firebase’s AI monitoring dashboard.
What Drives The Build Cost
Build cost depends on your team’s rates, so instead of a single number, here are the line items that move the estimate, from smallest to largest:
- AI chat screen on an existing app: Flutter AI Toolkit, Firebase AI Logic, App Check, authentication and usage limits. The smallest scope.
- AI feature tied to your own data: adds a backend, document ingestion, retrieval (RAG) and evaluation of answer quality.
- Multimodal features: camera or file input, voice through the Live API, image generation, plus the extra testing they need across devices.
- On device or hybrid AI: model selection, download management, fallback logic and testing on low end devices.
- Regulated industries: privacy review, data retention rules and audit logging for health, finance or education apps.
Evaluation is the line item most teams underestimate. Someone has to test real prompts, catch wrong answers and tune instructions before launch, and again whenever you switch models.
Our Flutter app development services include this as a fixed step in AI projects.
Security And Privacy Checklist Before Launch
- Enforce App Check (required for Firebase AI Logic from November 2, 2026).
- Never embed any AI provider key in the app; use Firebase AI Logic or your own backend.
- Restrict AI requests to signed in users and keep per user rate limits on.
- Use a paid tier for any customer data, and tell users in your privacy policy which provider processes their prompts.
- Validate structured output before acting on it, especially when the model can trigger functions such as bookings or payments.
- Keep model names in Remote Config so you can respond to model retirements and price changes without an app release.
When Flutter Is Not The Right Choice For Your AI App
Flutter is a strong fit for most AI features because the AI work happens in the model, not the UI framework. Native development is the better call in a few cases:
- You need new platform AI features on day one. Firebase’s hybrid on device inference arrives in the native Apple and Android SDKs first, and Flutter access to OS level models depends on community packages.
- The core feature is a heavy real time camera pipeline, such as continuous video analysis at high frame rates, where tight control over native camera and GPU APIs matters more than shared UI code.
- You are shipping on one platform only and your team is already native. A single platform product gains little from a cross platform framework.
For everything else, including chat assistants, document tools, AI search and recommendations, one Flutter codebase for iOS, Android and web usually ships faster and costs less to maintain.
A Practical Build Plan
- Define one job for the AI. “Answer questions about a user’s orders” beats “add an AI assistant”.
- Prototype on the Gemini free tier with test data only, using the Flutter AI Toolkit for the interface.
- Measure tokens per task with real prompts, then plug the numbers into the cost model above.
- Pick the cheapest model that passes your quality tests, and decide whether any part should run on device.
- Harden for production: App Check, authentication, rate limits, paid tier, budget alerts, Remote Config model names.
- Launch to a small group, review real conversations and costs, then expand.
Planning An AI Feature For Your Flutter App?
The fastest way to avoid an expensive rebuild is to settle the architecture, model and cost per user before writing production code. If you want help scoping an AI feature, estimating its running cost or adding Gemini to an existing Flutter app, talk to our Flutter team.
Frequently Asked Questions
Q: Can Flutter Apps Use Gemini Directly?
Yes. The firebase_ai package from Firebase AI Logic lets a Flutter app call Gemini models directly from the client, with Firebase acting as a secure proxy so your API key is not stored in the app.
Q: How Do I Add ChatGPT Or OpenAI To A Flutter App?
Call the OpenAI API from your own backend, such as Cloud Functions, and have the Flutter app talk to that backend. Do not place an OpenAI key inside the app, because it can be extracted from the build.
Q: Can Flutter Run AI Models Offline?
Yes. The flutter_gemma package runs small language models such as Gemma fully on device, and newer versions can use Gemini Nano on supported Android phones and Apple Foundation Models on iOS 26 and later. Expect lower answer quality than cloud models and check device support for your audience.
Q: How Much Does It Cost To Run AI In A Flutter App?
With Google’s October 2026 prices, a chat assistant used by 10,000 people sending 30 messages a month costs roughly $290 to $2,340 per month depending on the Gemini model, or about 3 to 23 cents per user. Your numbers depend on message length, chat history and model choice.
Q: Is The Flutter AI Toolkit Ready For Production?
The chat widgets are practical for production chat screens when paired with Firebase AI Logic and App Check. The separate GenUI SDK, which generates interface elements from model output, is still early and better suited to prototypes.



