Gemini API using Vertex AI in Firebase

Build AI-powered mobile and web apps and features with the Gemini API using Vertex AI in Firebase

The Vertex AI Gemini API gives you access to the latest generative AI models from Google: the Gemini models. If you need to call the Vertex AI Gemini API directly from your mobile or web app – rather than server-side — you can use the Vertex AI in Firebase SDKs. These client SDKs are built specifically for use with mobile and web apps, offering security options against unauthorized clients as well as integrations with other Firebase services.

With these client SDKs, you can add AI personalization to your app, build an AI chat experience, create AI-powered optimizations and automation, and much more!


Ready to get started? Choose your platform:

iOS+ Android Web Flutter

If you're looking for ways to call the Vertex AI Gemini API server-side (like with Python, Node.js, or Go), check out the server-side Vertex AI SDKs, Firebase Genkit, or Firebase Extensions for the Gemini API.

Key capabilities

Multimodal input The Gemini models are multimodal, so prompts sent to the Gemini API can include text, images (even PDFs), video, and audio.
Growing suite of capabilities With the SDKs, you can call the Gemini API directly from your mobile or web app, build an AI chat experience, use function calling, and more.
Security for production apps Use Firebase App Check to protect the Vertex AI Gemini API from abuse by unauthorized clients.
Robust infrastructure Take advantage of scalable infrastructure that's built for use with mobile and web apps, like managing structured data with Firebase database offerings (like Cloud Firestore) and dynamically setting run-time configurations with Firebase Remote Config.

How does it work?

The Vertex AI in Firebase SDKs allow you to call the Vertex AI Gemini API directly from your mobile or web app removing the need to set up a backend.

Learn more about the Gemini API from Vertex AI, which gives you access to the Gemini models.

Implementation path

Connect your app to Firebase Register your app with your Firebase project, and then add your Firebase configuration to your app.
Install the SDK and initialize Install the Vertex AI in Firebase SDK that's specific to your app's platform, and then initialize the Vertex AI service and the generative model in your app.
Call the Gemini API Call the Gemini API with either text-only or multimodal prompts to generate text output. Use more complex calls to build chat experiences or use function calling.
Prepare for production Implement important integrations for mobile and web apps, like protecting the API from abuse with Firebase App Check and including large files in requests using Cloud Storage for Firebase URLs.

Next steps

Get started with the Vertex AI Gemini API in your mobile or web app

iOS+ setup Android setup Web setup Flutter setup

Experiment with prompts

Go to Vertex AI Studio

Learn more about the Gemini models

Learn about the models available for various use cases and their quotas and pricing.