# Gemini&nbsp;API using Firebase AI&nbsp;Logic

Build AI-powered mobile and web apps and features with the Gemini models using Firebase AI Logic

## Docs

- [Gemini&nbsp;API using Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic.md.txt): Build AI-powered mobile and web apps and features with the Gemini models using Firebase AI Logic
- [Analyze audio files using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/analyze-audio.md.txt): A guide to analyzing audio files using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Analyze documents (like PDFs) using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/analyze-documents.md.txt): A guide to analyzing documents (like PDFs) using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Analyze image files using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/analyze-images.md.txt): A guide to analyzing image files using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Prevent Gemini&nbsp;API abuse with Firebase App Check](https://firebase.google.com/docs/ai-logic/app-check.md.txt): A guide to implementing Firebase App Check to protect APIs (like the Gemini API) from unauthorized clients.
- [Build multi-turn conversations (chat) using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/chat.md.txt): A guide to building multi-turn conversations (chat) using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Expand the content of an image using outpainting with Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-expand-images.md.txt): A guide to expanding the content of an image using outpainting with Imagen via the Firebase AI Logic client SDKs.
- [Remove objects from images using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-remove-objects.md.txt): A guide to removing objects from images using Imagen via the Firebase AI Logic client SDKs.
- [Customize images based on a specified subject using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-subject-customization.md.txt): A guide to customizing images based on a specified subject using Imagen via the Firebase AI Logic client SDKs.
- [Error codes](https://firebase.google.com/docs/ai-logic/error-codes.md.txt): Troubleshooting of error codes for the Gemini API and Firebase AI Logic.
- [Function calling using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/function-calling.md.txt): A guide to using function calling with the Gemini API via the Firebase AI Logic client SDKs.
- [Generate audio using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/generate-audio.md.txt): An overview of options for generating audio using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Build hybrid experiences in Android apps with on-device and cloud-hosted models](https://firebase.google.com/docs/ai-logic/hybrid/android/get-started.md.txt): A guide to building hybrid AI experiences in Android apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Generate structured output for hybrid experiences in Web apps](https://firebase.google.com/docs/ai-logic/hybrid/web/generate-structured-output.md.txt): A guide to generating structured output (like JSON and enums) for hybrid AI experiences in web apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Build hybrid experiences in Web apps with on-device and cloud-hosted models](https://firebase.google.com/docs/ai-logic/hybrid/web/get-started.md.txt): A guide to building hybrid AI experiences in web apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Migrate from Imagen to a Gemini&nbsp;Nano&nbsp;Banana model](https://firebase.google.com/docs/ai-logic/imagen-models-migration.md.txt): A guide to migrating an app from using Imagen models to Gemini Nano Banana models when using the Firebase AI Logic client SDKs.
- [Supported input files and requirements](https://firebase.google.com/docs/ai-logic/input-file-requirements.md.txt): A guide to the supported input files and requirements for multimodal requests.
- [Get started with the Gemini&nbsp;Live&nbsp;API using Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/live-api.md.txt): A guide to getting started with the Gemini Live API via the Firebase AI Logic client SDKs.
- [Limits and specifications of the Live&nbsp;API](https://firebase.google.com/docs/ai-logic/live-api/limits-and-specs.md.txt): A reference guide to the limits and specifications of the Gemini Live API via the Firebase AI Logic client SDKs.
- [Migrate to the Firebase AI&nbsp;Logic&nbsp;SDKs from the Google&nbsp;AI client&nbsp;SDKs](https://firebase.google.com/docs/ai-logic/migrate-from-google-ai-client-sdks.md.txt): A guide to migrating from the Google AI client SDKs to the Firebase AI Logic client SDKs.
- [Migrate to the Firebase AI&nbsp;Logic&nbsp;SDKs from the GA version of Vertex&nbsp;AI&nbsp;in&nbsp;Firebase SDKs](https://firebase.google.com/docs/ai-logic/migrate-to-latest-sdk.md.txt): A guide to migrating from the GA versions of the Vertex AI for Firebase client SDKs to the Firebase AI Logic client SDKs.
- [Use model configuration to control responses](https://firebase.google.com/docs/ai-logic/model-parameters.md.txt): A guide to using model configuration to control responses from Gemini models when using the Firebase AI Logic client SDKs.
- [Understand prompt design](https://firebase.google.com/docs/ai-logic/prompt-design.md.txt): A guide to understanding prompt design for Gemini models.
- [Reference documentation for the Firebase AI&nbsp;Logic&nbsp;SDKs](https://firebase.google.com/docs/ai-logic/ref-docs.md.txt): An overview of available reference documentation for the Firebase AI Logic client SDKs.
- [Understand and configure safety settings](https://firebase.google.com/docs/ai-logic/safety-settings.md.txt): Understand and configure safety settings, safety filters, and safety ratings for Gemini models when using the Firebase AI Logic client SDKs.
- [Advanced workflows for templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/advanced-workflows.md.txt): A guide to more advanced workflows for Firebase AI Logic server prompt templates using the REST API, like specifying a template&#39;s location or providing the template as a file.
- [Get started with server prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started.md.txt): A guide to getting started with Firebase AI Logic server prompt templates, including how to create, test, and access them in your application&#39;s code.
- [Manage templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/manage-templates.md.txt): A guide to managing your Firebase AI Logic server prompt templates, including how to edit, lock, delete, and version your templates for better organization.
- [Overview: Firebase AI&nbsp;Logic solutions](https://firebase.google.com/docs/ai-logic/solutions/overview.md.txt): An overview of solutions for more advanced use cases with Firebase AI Logic.
- [Dynamically update your Firebase AI&nbsp;Logic app with Firebase Remote Config](https://firebase.google.com/docs/ai-logic/solutions/remote-config.md.txt): A guide to using Firebase Remote Config to dynamically configure your app when using the Firebase AI Logic client SDKs.
- [Use system instructions to steer the behavior of a model](https://firebase.google.com/docs/ai-logic/system-instructions.md.txt): A guide to using system instructions to steer the behavior of a model.
- [Thinking](https://firebase.google.com/docs/ai-logic/thinking.md.txt): A guide to using the thinking feature of Gemini models when using the Firebase AI Logic client SDKs.
- [URL context](https://firebase.google.com/docs/ai-logic/url-context.md.txt): Build AI-powered mobile and web apps and features with the Gemini API using Firebase AI Logic
- [Analyze video files using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/analyze-video.md.txt): A guide to analyzing video files using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Remotely change the model name in your app](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt): A guide to remotely changing the model name in your app by using Firebase Remote Config to dynamically control which model your app uses.
- [Code execution](https://firebase.google.com/docs/ai-logic/code-execution.md.txt): A guide to using the code execution tool to generate and run Python code when using Firebase AI Logic client SDKs.
- [Context caching in Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/context-caching.md.txt): A guide to creating and managing context cache, including explicit caching, when using Firebase AI Logic client SDKs.
- [Options to control generation of responses](https://firebase.google.com/docs/ai-logic/control-content-gen.md.txt): An overview of options for controlling the generation of responses from Gemini models when using the Firebase AI Logic client SDKs.
- [Count tokens for Gemini models](https://firebase.google.com/docs/ai-logic/count-tokens.md.txt): A guide to counting tokens for Gemini models.
- [Data governance &amp; Responsible AI](https://firebase.google.com/docs/ai-logic/data-governance.md.txt): An overview of data governance and responsible AI when using Firebase AI Logic.
- [Customize images based on a control using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-controlled-customization.md.txt): A guide to customizing images based on a control using Imagen via the Firebase AI Logic client SDKs.
- [Insert objects into images using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-insert-objects.md.txt): A guide to inserting objects into images using Imagen via the Firebase AI Logic client SDKs.
- [Overview of editing images with Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-overview.md.txt): An overview of options for editing images with Imagen (including mask-based editing and customization) via the Firebase AI Logic client SDKs.
- [Replace the background of an image using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-replace-background.md.txt): A guide to replacing the background of an image using Imagen via the Firebase AI Logic client SDKs.
- [Customize images based on a specified style using Imagen](https://firebase.google.com/docs/ai-logic/edit-images-imagen-style-customization.md.txt): A guide to customizing images based on a specified style using Imagen via the Firebase AI Logic client SDKs.
- [FAQ and troubleshooting](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt): A collection of frequently asked questions and troubleshooting for the Gemini API and Firebase AI Logic.
- [Give feedback about Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/feedback.md.txt): An overview of options for providing feedback about Firebase AI Logic.
- [Generate &amp; edit images using Gemini&nbsp;Nano&nbsp;Banana](https://firebase.google.com/docs/ai-logic/generate-images-gemini.md.txt): A guide to generating and editing images using Gemini Nano Banana models via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Generate images using Imagen](https://firebase.google.com/docs/ai-logic/generate-images-imagen.md.txt): A guide to generating images using Imagen models via the Firebase AI Logic client SDKs.
- [Generate structured output (like JSON and enums) using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/generate-structured-output.md.txt): A guide to generating structured output (like JSON and enums) using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Generate text using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/generate-text.md.txt): A guide to generating text from text-only and multimodal prompts using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Get started with the Gemini&nbsp;API using the Firebase AI&nbsp;Logic&nbsp;SDKs](https://firebase.google.com/docs/ai-logic/get-started.md.txt): A guide to getting started with the Gemini API using the Firebase AI Logic client SDKs.
- [Grounding with Google&nbsp;Search](https://firebase.google.com/docs/ai-logic/grounding-google-search.md.txt): A guide to grounding Gemini models with Google Search to provide more accurate and up-to-date answers.
- [Build hybrid and on-device experiences with Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/hybrid.md.txt): An overview of options for building hybrid experiences with Firebase AI Logic.
- [Configuration options for hybrid experiences in Android apps](https://firebase.google.com/docs/ai-logic/hybrid/android/configuration-options.md.txt): A guide to configuration options for hybrid AI experiences in Android apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Configuration options for hybrid experiences in Web apps](https://firebase.google.com/docs/ai-logic/hybrid/web/configuration-options.md.txt): A guide to configuration options for hybrid AI experiences in web apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Capabilities of the Live&nbsp;API](https://firebase.google.com/docs/ai-logic/live-api/capabilities.md.txt): A guide to the core capabilities of the Gemini Live API via the Firebase AI Logic client SDKs.
- [Configuration options for the Live&nbsp;API](https://firebase.google.com/docs/ai-logic/live-api/configuration.md.txt): A guide to configuration options for the Gemini Live API via the Firebase AI Logic client SDKs.
- [Manage sessions for the Live&nbsp;API](https://firebase.google.com/docs/ai-logic/live-api/sessions.md.txt): A reference guide to managing sessions for the Gemini Live API via the Firebase AI Logic client SDKs.
- [Specify the location for accessing the model](https://firebase.google.com/docs/ai-logic/locations.md.txt): A guide to specifying the location for accessing a generative AI model.
- [Migrate to the Firebase AI&nbsp;Logic&nbsp;SDKs from the Preview version of Vertex&nbsp;AI&nbsp;in&nbsp;Firebase SDKs](https://firebase.google.com/docs/ai-logic/migrate-from-preview.md.txt): A guide to migrating from the Preview versions of the Vertex AI for Firebase client SDKs to the Firebase AI Logic client SDKs.
- [Learn about supported models](https://firebase.google.com/docs/ai-logic/models.md.txt): A guide to the supported Gemini models for Firebase AI Logic.
- [Monitor costs, usage, and other metrics](https://firebase.google.com/docs/ai-logic/monitoring.md.txt): A guide to monitoring costs, usage, and other metrics when using Firebase AI Logic.
- [Understand pricing](https://firebase.google.com/docs/ai-logic/pricing.md.txt): A guide to understanding the pricing for Firebase AI Logic and the Gemini API.
- [Production checklist for using Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/production-checklist.md.txt): A production checklist for using Firebase AI Logic.
- [Rate limits and quotas](https://firebase.google.com/docs/ai-logic/quotas.md.txt): A guide to rate limits and quotas for the Gemini API and Firebase AI Logic.
- [Best practices and considerations for templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/best-practices-and-considerations.md.txt): A guide to best practices and other considerations for Firebase AI Logic server prompt templates, including a list of features that are not yet supported.
- [Template format, syntax, and examples](https://firebase.google.com/docs/ai-logic/server-prompt-templates/syntax-and-examples.md.txt): Build AI-powered mobile and web apps and features with the Gemini API using Firebase AI Logic
- [Version templates using Remote Config](https://firebase.google.com/docs/ai-logic/server-prompt-templates/versioning-with-remote-config.md.txt): A guide to versioning your Firebase AI Logic server prompt templates by using Firebase Remote Config to dynamically control the template ID used in your app.
- [Include large files in multimodal requests and manage files using Cloud Storage for Firebase](https://firebase.google.com/docs/ai-logic/solutions/cloud-storage.md.txt): A guide to using Cloud Storage for Firebase to include large files in multimodal requests when using the Firebase AI Logic client SDKs.
- [Stream generated text responses using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/stream-responses.md.txt): A guide to streaming generated text responses using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Enforce template-only mode](https://firebase.google.com/docs/ai-logic/server-prompt-templates/template-only-mode.md.txt): A guide to enforcing template-only mode which blocks all requests that do not use server prompt templates.
- [Available capabilities when accessing the Gemini&nbsp;API through Apple's Foundation Models framework](https://firebase.google.com/docs/ai-logic/apple-foundation-models-framework/capabilities.md.txt): A reference of code examples showing the capabilities of using Firebase AI Logic to access the Gemini API through Apple&#39;s Foundation Models framework.
- [Get started: Access the Gemini&nbsp;API through Apple's Foundation Models framework](https://firebase.google.com/docs/ai-logic/apple-foundation-models-framework/get-started.md.txt): A guide to getting started with using Firebase AI Logic to access the Gemini API through Apple&#39;s Foundation Models framework.
- [Configuration options when accessing the Gemini&nbsp;API through Apple's Foundation Models framework](https://firebase.google.com/docs/ai-logic/apple-foundation-models-framework/configuration.md.txt): A guide showing the configuration options when using Firebase AI Logic to access the Gemini API through Apple&#39;s Foundation Models framework.
- [Provide tools to the model when accessing the Gemini&nbsp;API through Apple's Foundation Models framework](https://firebase.google.com/docs/ai-logic/apple-foundation-models-framework/tools.md.txt): A guide showing tools available when using Firebase AI Logic to access the Gemini API through Apple&#39;s Foundation Models framework.
- [Restrict requests to only authenticated users](https://firebase.google.com/docs/ai-logic/auth-mode.md.txt): A guide to enforcing authenticated-users mode which blocks all requests from unauthenticated end users.
- [Grounding with Google&nbsp;Maps](https://firebase.google.com/docs/ai-logic/grounding-google-maps.md.txt): A guide to grounding Gemini models with Google Maps to provide geospatial data for location-aware functionality.
- [Configuration options for hybrid experiences in Apple apps](https://firebase.google.com/docs/ai-logic/hybrid/ios/configuration-options.md.txt): A guide to configuration options for hybrid AI experiences in Apple apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Build hybrid experiences in Apple apps with on-device and cloud-hosted models](https://firebase.google.com/docs/ai-logic/hybrid/ios/get-started.md.txt): A guide to building hybrid AI experiences in Apple apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Multi-turn interactions with server prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/multi-turn-interactions.md.txt): A guide to getting started with Firebase AI Logic server prompt templates using multi-turn interactions, like chat and function calling.
- [Text-to-speech generation (TTS) using the Gemini&nbsp;API](https://firebase.google.com/docs/ai-logic/generate-speech.md.txt): A guide for text-to-speech (TTS) generation using the Gemini API via the Firebase AI Logic client SDKs for Apple (Swift), Android (Kotlin / Java), Web (JavaScript), Flutter (Dart), and Unity.
- [Security checklist for using Firebase AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/security-checklist.md.txt): A security checklist for using Firebase AI Logic.
- [Run custom server-side scripts before and after requests](https://firebase.google.com/docs/ai-logic/pre-and-post-request-scripts.md.txt): A guide to creating server-side scripts that can run before or after each request to the Gemini API when using Firebase AI Logic.
- [Generate structured output for hybrid experiences in Android apps](https://firebase.google.com/docs/ai-logic/hybrid/android/generate-structured-output.md.txt): A guide to generating structured output (like JSON and enums) for hybrid AI experiences in Android apps with on-device and cloud-hosted models using Firebase AI Logic.
- [Cloud Audit Logs for AI&nbsp;Logic](https://firebase.google.com/docs/ai-logic/cloud-audit-logs.md.txt): A guide to Cloud Audit Logs for Firebase AI Logic, detailing audited API methods, required IAM permissions, and step-by-step instructions to view logs.