Firebase AI Logic | Build generative AI features directly into your mobile and web apps
Access the latest Gemini models without server-side setup
Firebase AI Logic is a production-ready managed service that allows you to securely call the Gemini API via client SDKs in your native stack—no context-switching to a backend language required. These client SDKs are built for use with mobile and web apps. You can use them to add AI personalization, AI chat, generate images, and integrate tools like Grounding with Google Search or Google Maps to enhance your app experience.
Simple setup, robust infrastructure
Get started quickly by enabling your Gemini API provider in the Firebase console. Then, with just a few lines of code, you or your preferred coding agent can build multimodal AI features directly in your app. Take advantage of scalable infrastructure by efficiently uploading and managing files with Cloud Storage for Firebase and setting granular file access controls using Firebase Security Rules.
Built-in protection for backend resources
Firebase App Check is deeply integrated with Firebase AI Logic to add a layer of protection for your Gemini API calls. You can confidently use these SDKs from your client without worrying about unauthorized access.
Seamless on-device and in-cloud model inference
Build AI-powered features for Apple, Android, and Web apps with hybrid inference. Hybrid inference lets you run inference using on-device models when available, for enhanced privacy, no-cost inference, and offline functionality, and seamlessly falling back to cloud-hosted models if an on-device model isn’t available (and vice versa).
Everything you need to power client-side AI features quickly and securely
Store your prompts, model configuration, system instructions, and output schemas securely on Firebase servers. Make updates from the Firebase console and the change will roll out instantly without requiring you to release a new version of your app.
Monitor every Gemini API call in the Firebase console. Understand the health of your AI features by tracking latency and token usage. You can even inspect traces when a user gets an unexpected response for faster debugging.
Easily build rich, conversational audio and video AI experiences in your apps with the Gemini Live API.
Use Cloud Functions for Firebase to set up custom logic and trigger workflows. Block specific keywords, enforce rate limits, remove data, or even append context to prompts.
Integrate with Model Armor for enterprise-grade safety—with protection against toxic content, PII leaks, and other risks when you access Gemini models via the Gemini Enterprise Agent Platform.
Use Firebase Remote Config to test and change AI parameters without releasing a new app version. Swap models, dynamically edit prompts, and more.
Documentation
Learn more about Firebase AI Logic through our documentation.
Pricing
Firebase AI Logic is a no-cost service, billed according to current Google Cloud or Gemini Developer API pricing.
Try Firebase today
Integrating it into your app is easy.
All Firebase products
Build
- App Check
- App Hosting
- Authentication
- Cloud Functions
- Cloud Storage
- SQL Connect
- Extensions
- Firestore
- Hosting
- Phone Number Verification
- Realtime Database
- Firebase AI Logic