This page provides answers to frequently asked questions (FAQs) and
troubleshooting information about Firebase AI Logic and using it with the
Gemini API:

- [**Status dashboards**](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#status-dashboards)
- [**General FAQ**](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#general)
- [**Changes FAQ**](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#changes) (such as model deprecations and shutdowns)
- [**Security FAQ**](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security)
  - [FAQs about Firebase App Check](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-app-check)
  - [FAQs about the Gemini API key](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-gemini-api-key)


As needed, here are some additional resources:

- Troubleshoot
  [error codes](https://firebase.google.com/docs/ai-logic/error-codes.md.txt).

- Learn about
  [billing setup, pricing, and payments](https://firebase.google.com/docs/ai-logic/pricing.md.txt).

- Learn about
  [rate limits and quotas](https://firebase.google.com/docs/ai-logic/quotas.md.txt).

<br />

*** ** * ** ***

## Status dashboards

- [Firebase AI Logic](https://status.firebase.google.com/)

- [Gemini Developer API](https://aistudio.google.com/status)

- [Agent Platform Gemini API (formerly Vertex AI)](https://status.cloud.google.com/#:%7E:text=Vertex%20Gemini%20API) (`Vertex Gemini API`)

<br />

*** ** * ** ***

## General FAQ

<br />

#### Differences between using the Gemini Developer API and the Agent Platform Gemini API (formerly Vertex AI)

<br />

The following table lists important differences between the two
"Gemini API" providers ***in general regardless of how you access them***:

|   | Gemini Developer API | Agent Platform Gemini API (formerly Vertex AI) |
|---|---|---|
| [**Pricing**](https://firebase.google.com/docs/ai-logic/pricing.md.txt) | Available on both the no-cost Spark pricing plan and the pay-as-you-go Blaze pricing plan^1^ | Always requires the pay-as-you-go Blaze pricing plan^1^ (when used with Firebase AI Logic) |
| **[Rate limits (quota)](https://firebase.google.com/docs/ai-logic/quotas.md.txt)** | Explicit rate limits | Uses dynamic shared quota (DSQ) that everyone using that model in that region shares. Provisioned throughput (PT) is available. |
| [**Specifying the location for accessing the model**](https://firebase.google.com/docs/ai-logic/locations.md.txt?api=vertex) | No not supported by the API | Yes supported by the API |
| **Support for [Cloud Storage URLs](https://firebase.google.com/docs/ai-logic/solutions/cloud-storage.md.txt)** | No not supported by the API ^2^ | Yes Public files and files protected by Firebase Security Rules |
| **Support for YouTube URLs and Browser URLs** | Yes YouTube URLs only | Yes YouTube URLs and Browser URLs |

^1^ *The two API providers have different pay-as-you-go pricing
(learn more in their respective documentation).*

^2^ *The
[Files API](https://ai.google.dev/api/files)
for the Gemini Developer API is not supported through the
Firebase AI Logic SDKs.*

<br />

The following table lists the availability of commonly asked about features for
the two "Gemini API" providers. This table applies ***specifically when
using the Firebase AI Logic client SDKs***.

| Feature | Gemini Developer API | Agent Platform Gemini API (formerly Vertex AI) |
|---|---|---|
| **Support for [Gemini models](https://firebase.google.com/docs/ai-logic/models.md.txt)** | Yes supported | Yes supported |
| **Support for the [Gemini Live API](https://firebase.google.com/docs/ai-logic/live-api.md.txt)** | Yes supported | Yes supported |
| **Integration with [Firebase App Check](https://firebase.google.com/docs/ai-logic/app-check.md.txt)** | Yes supported | Yes supported |
| **Compatible with [Firebase Remote Config](https://firebase.google.com/docs/ai-logic/solutions/remote-config.md.txt)** | Yes supported | Yes supported |
| **Support for [AI monitoring in Firebase console](https://firebase.google.com/docs/ai-logic/monitoring.md.txt#ai-monitoring-in-console)** | Yes supported | Yes supported |

> [!NOTE]
> **Note:** *When using Firebase AI Logic* , the following capabilities are ***not*** supported: grounding with Google Image Search, fine tuning a model, embeddings generation, and semantic retrieval.

<br />

<br />

<br />

#### How to use both the Gemini Developer API and the Agent Platform Gemini API (formerly Vertex AI)

<br />

You can have both Gemini API providers enabled in your Firebase project, and
you can use both APIs in your app itself.

To switch between API providers in your code, just make sure that you've
[set the backend service appropriately in your code](https://firebase.google.com/docs/ai-logic/get-started.md.txt#initialize-service-and-model).

> [!IMPORTANT]
> **Important:** If your project is on the pay-as-you-go Blaze pricing plan (which is required to use the Agent Platform Gemini API (formerly Vertex AI) and several other products in the Firebase and Google Cloud ecosystem), be aware that *all calls* to the Gemini Developer API are pay-as-you-go.

<br />

<br />

<br />

#### Required APIs and how to enable them

<br />

|---|
| *Select your Gemini API provider to view provider-specific content* <button value="dev" default="">Gemini Developer API</button> <button value="vertex">Agent Platform Gemini API</button> |

To use the Firebase AI Logic SDKs with the
Gemini Developer API, your project must have the following two APIs
enabled:

- [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_) (`generativelanguage.googleapis.com`)
- [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (`firebasevertexai.googleapis.com`)

You should enable these two APIs using the Firebase console:

1. In the Firebase console, go to **AI Services** \>
   [**AI Logic**](https://console.firebase.google.com/project/_/ailogic/?useAutoProject=true).

2. Click **Get started**.

3. Select to get started with the Gemini Developer API.

   This launches a guided workflow that enables the two APIs for you. Firebase
   will also provision a Google-managed service account (P4SA) for
   authorizing use of the Gemini API, as well as add the
   Firebase AI Logic API to the allowlist for your
   Firebase API key.

<br />

<br />

<br />

#### How to disable APIs in a Firebase project

<br />

For Firebase AI Logic, we try to make setup of your Firebase project to use
your chosen Gemini API provider as easy as possible. This includes enabling
the [required APIs](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#required-apis)
in your Firebase project during specific journeys, like the guided workflow in
the Firebase console.

However, if you decide to not use Firebase AI Logic or one of the
Gemini API providers, you can disable the associated APIs in your
Firebase project.

> [!WARNING]
> **Warning** : **Before you disable an API, be aware of the following:**
>
> - If you disable a required API and you have a feature in your app that relies on that API, then that feature will break across all versions of your app when you disable the API.
> - If you disable the Gemini Developer API or the Agent Platform API in your Firebase project, then you're disabling its usage for *all use cases* of that API, not just for Firebase AI Logic. Confirm that you're not using the API for other reasons (like with Genkit, the GenAI server-side SDKs, ADK, etc.).
>
> You can check the level of usage for an API in its respective API page in
> the Google Cloud console before you disable it (find links to each API page
> in the instructions below).

<br />

#### Disable APIs associated with using Gemini Developer API

<br />

To use the Firebase AI Logic SDKs with the
Gemini Developer API, your project must have the following two APIs
enabled:

- [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_) (`generativelanguage.googleapis.com`)
- [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (`firebasevertexai.googleapis.com`)

**If you want to stop using Firebase AI Logic completely:**

1. Click each API link above to go to the respective API pages in the
   Google Cloud console, then click **Manage**.

2. View the **Metrics** tab to verify that there's no usage of the API.

3. If you still want to disable the API, click **Disable API** at the top of
   the page.

4. Remove the Firebase AI Logic API from the list of selected
   APIs that can be called using your Firebase API keys. Review
   [this FAQ about the allowlist for Firebase API keys](https://firebase.google.com/docs/projects/api-keys.md.txt#faq-required-apis-for-restricted-firebase-api-key)
   to learn about modifying this list.

**If you want to continue using Firebase AI Logic, but with the
Agent Platform Gemini API (formerly Vertex AI) instead:**

1. Go to the [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_) page in the
   Google Cloud console, then click **Manage**.

2. View the **Metrics** tab to verify that there's no usage of the API.

3. If you still want to disable the API, click **Disable API** at the top of
   the page.

4. Make sure that your project has the
   [required APIs enabled](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt?api=vertex#required-apis)
   for the Agent Platform Gemini API (formerly Vertex AI).

<br />

<br />

<br />

#### Disable APIs associated with using Agent Platform Gemini API (formerly Vertex AI)

<br />

To use the Firebase AI Logic SDKs with the
Agent Platform Gemini API (formerly Vertex AI), your project must have the following two APIs
enabled:

- [Agent Platform API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com?project=_) (`aiplatform.googleapis.com`)
- [Firebase AI Logic API](https://console.cloud.google.com/apis/library/firebasevertexai.googleapis.com?project=_) (`firebasevertexai.googleapis.com`)

**If you want to stop using Firebase AI Logic completely:**

1. Click each API link above to go to the respective API pages in the
   Google Cloud console, then click **Manage**.

2. View the **Metrics** tab to verify that there's no usage of the API.

3. If you still want to disable the API, click **Disable API** at the top of
   the page.

4. Remove the Firebase AI Logic API from the list of selected
   APIs that can be called using your Firebase API keys. Review
   [this FAQ about the allowlist for Firebase API keys](https://firebase.google.com/docs/projects/api-keys.md.txt#faq-required-apis-for-restricted-firebase-api-key)
   to learn about modifying this list.

**If you want to continue using Firebase AI Logic, but with the
Gemini Developer API instead:**

1. Go to the [Agent Platform API](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com?project=_) page in the
   Google Cloud console, then click **Manage**.

2. View the **Metrics** tab to verify that there's no usage of the API.

3. If you still want to disable the API, click **Disable API** at the top of
   the page.

4. Make sure that your project has the
   [required APIs enabled](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt?api=dev#required-apis)
   for the Gemini Developer API.

<br />

<br />

<br />

<br />

<br />

#### Required permissions to use Firebase AI Logic

<br />

<br />

| **Action** | **Required IAM permissions** | **IAM role(s) that include required permissions by default** |
|---|---|---|
| Upgrade billing to pay-as-you-go (Blaze) pricing plan | `firebase.billingPlans.update` `resourcemanager.projects.createBillingAssignment` `resourcemanager.projects.deleteBillingAssignment` | [Owner](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) |
| Enable APIs in project | `serviceusage.services.enable` | [Editor](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) [Owner](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) |
| Create Firebase app | `firebase.clients.create` | [Firebase Admin](https://firebase.google.com/docs/projects/iam/roles-predefined-all-products.md.txt) [Editor](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) [Owner](https://firebase.google.com/docs/projects/iam/roles-basic.md.txt) |

<br />

<br />

<br />

<br />

#### Supported models when using Firebase AI Logic

<br />

See the [list of supported models](https://firebase.google.com/docs/ai-logic/models.md.txt#available-model-names).
We frequently add new capabilities to the SDKs, so check back on this FAQ for
updates (as well as in release notes, blogs, and social posts).

- **Firebase AI Logic supports the following models:**

  - **Gemini Developer API**

    - Most of the Gemini foundation models
  - **Agent Platform Gemini API (formerly Vertex AI)**

    - Most of the Gemini foundation models
- **Firebase AI Logic does *not* support the following models**
  (regardless of your chosen Gemini API provider):

  - Fine-tuned models

  - Embedding models,
    Veo models,
    Lyria models,
    robotics models,
    computer use models,
    Gemini Omni models, or
    Gemini Cyber models

  > [!NOTE]
  > **Note:** Gemma-based models are only supported in some configurations when using a [hybrid or on-device implementation](https://firebase.google.com/docs/ai-logic/hybrid.md.txt).

<br />

<br />

<br />

#### How to set a per-user rate limit

<br />

By default, Firebase AI Logic sets the request limit per user at
100 requests per minute (RPM).

If you want to adjust your per-user rate limit, you need to adjust the quota
settings for the Firebase AI Logic API.

Learn more about the
[Firebase AI Logic API quota](https://firebase.google.com/docs/ai-logic/quotas.md.txt).
On that page, you can also learn how to view and edit your quota.

<br />

<br />

<br />

#### How to reduce latency and high token usage

<br />

If you're experiencing high latency or high token usage, it's likely due to the
[*thinking level* configuration](https://firebase.google.com/docs/ai-logic/thinking.md.txt#control-thinking-amount)
for the model you're using.

Gemini 3 and later models always use an internal "thinking process"
that significantly improves their reasoning and multi-step planning abilities,
making them highly effective for complex tasks such as coding, advanced
mathematics, and data analysis.

However, depending on the task, higher levels of thinking aren't always needed,
and you can configure the model to use a lower thinking level. **A lower
thinking level will help reduce latency and token usage.** To help you decide
how much a model might need its thinking capability, review the
[comparison of task difficulties](https://firebase.google.com/docs/ai-logic/thinking.md.txt#task-complexity).

Note that for most Gemini 3 and later models, the
[default thinking level](https://firebase.google.com/docs/ai-logic/thinking.md.txt#supported-thinking-level-values)
is set to `HIGH`.

<br />

<br />

<br />

#### MIME type requirements for multimodal requests (like for images, PDFs, video, and audio input)

<br />

In each multimodal request, you must always provide the following:

- The file's `mimeType`. *See an exception below.*

- The file. You can either provide the file as inline data or provide the file
  using its URL.

Learn about supported input file types, how to specify MIME type, and the two
options for providing the file in
[Supported input files and requirements](https://firebase.google.com/docs/ai-logic/input-file-requirements.md.txt).

#### Exception to including MIME type in your request

An exception to providing the MIME type is inline image inputs for
requests from native Android and Apple platform apps.

The Firebase AI Logic SDKs for Android and Apple platforms provide a
simplified and platform-friendly way to handle images in requests --- all images
(no matter their format) are converted client-side to JPEG at 80% quality before
being sent to the server. This means that **when you provide
*images as inline data* using the Android and Apple platforms SDKs, you don't
need to specify the MIME type in the request**.

This simplified handling is shown in the Firebase AI Logic documentation in
the examples for sending base64-encoded images in requests.

Here's some additional platform-specific information about this feature:

- **For Android**:

  - You can take advantage of the simplified way to handle platform-native image
    types (`Bitmap`) in multimodal prompts that contain images as inline data
    (see [example](https://firebase.google.com/docs/ai-logic/analyze-images.md.txt#base64)).

  - For more control over image formats and conversions, you may provide the
    images as an `InlineDataPart` and supply the specific MIME type.
    For example:

    `content { inlineData(/* PNG as byte array */, "image/png") }`
- **For Apple platforms**:

  - You can take advantage of the simplified way to handle platform-native image
    types (`UIImage`, `NSImage`, `CIImage`, and `CGImage`) in multimodal prompts
    that contain images as inline data
    (see [example](https://firebase.google.com/docs/ai-logic/analyze-images.md.txt#base64)).

  - For more control over image formats and conversions, you may provide the
    images as an `InlineDataPart` and supply the specific MIME type.
    For example:

    `InlineDataPart(data: Data(/* PNG Data */), mimeType: "image/png")`

<br />

<br />

<br />

#### Advanced features not-yet-available when using Firebase AI Logic: Grounding with Google Image Search, fine tuning a model, embeddings generation, and semantic retrieval

<br />

The following features are supported by various models and the API providers,
but ***they are not available when using Firebase AI Logic***:

- Grounding with Google Image Search
- Fine tuning a model
- Embeddings generation
- Semantic retrieval

If you would like to add these as feature requests or vote on an existing
feature request, visit
[Firebase UserVoice](https://firebase.uservoice.com/forums/948424-general?category_id=501080).

<br />

<br />

<br />

#### Data usage for training models

<br />

See [Data governance \& Responsible AI](https://firebase.google.com/docs/ai-logic/data-governance.md.txt).

<br />

<br />

<br />

*** ** * ** ***

## Changes FAQ

This section contains FAQs related to model deprecations or shutdown, as well as
changes to the APIs, SDKs, or our branding.

<br />

#### Deprecated or shut down (retired) models - list and replacements

<br />

When Google releases a stable model version, we strive to keep it available for
*at minimum* 12 months before we shut down (retire) the model.

However, be aware of the following:

- For the Agent Platform Gemini API (formerly Vertex AI), some stable models
  only have
  [*short-term availability*](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions#short-term-availability),
  which means that they may be shut down (retired) as early as 45 days
  after a replacement model is released.

- For the Gemini Developer API, sometimes instead of shutting down a
  model, the service will automatically route the request to a newer model.
  Requests to the newer model are billed at the rates of the newer model.

- Several weeks before the shutdown date, projects that have no prior usage of a
  model will be blocked from starting to use it.

- When a stable version is released for a given model, all experimental and
  preview versions of that model will usually be shut down (retired) within a
  few days or weeks (this FAQ doesn't list every previous preview and
  experimental model).

> [!IMPORTANT]
> **Important:** Make sure to review the FAQ about the [changes required when models are deprecated or shut down (retired)](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#shutdown-models-what-to-do). You need to make changes to your app *before the shutdown date*; otherwise, any requests to a shutdown model will fail with a 404 error.

##### General-use models

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `gemini-3.7-flash` ^1^ <br /> Release date: August 13, 2026 Release stage: Stable | Requests routed to `gemini-3.8-flash` Replacement: `gemini-3.8-flash` | Shutdown date: January 28, 2027 Replacement: `gemini-3.8-flash` |
| `gemini-3.6-flash` ^1^ <br /> Release date: July 21, 2026 Release stage: Stable | Shutdown date: --- Replacement: `gemini-3.8-flash` | Shutdown date: November 19, 2026 Replacement: `gemini-3.8-flash` |
| `gemini-3.5-flash` <br /> Release date: May 19, 2026 Release stage: Stable | Requests routed to `gemini-3.6-flash` Replacement: `gemini-3.8-flash` | Shutdown date: --- Replacement: `gemini-3.8-flash` |
| `gemini-3.1-pro-preview` <br /> Release date: February 19, 2026 Release stage: Preview | Shutdown date: --- Replacement: `gemini-4-argon` | Shutdown date: --- Replacement: `gemini-4-argon` |

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `gemini-2.5-pro` <br /> Release date: June 17, 2025 Release stage: Stable | Requests routed to `gemini-3.8-flash` *(starting December 1, 2026)* Replacement: `gemini-3.8-flash` | Shutdown date: October 20, 2026 Replacement: `gemini-3.8-flash` |
| `gemini-2.5-flash` <br /> Release date: June 17, 2025 Release stage: Stable | Requests routed to `gemini-3.5-flash-lite` *(starting December 1, 2026)* Replacement: `gemini-3.5-flash-lite` | Shutdown date: October 20, 2026 Replacement: `gemini-3.5-flash-lite` |
| `gemini-2.5-flash-lite` <br /> Release date: July 22, 2025 Release stage: Stable | Shutdown date: --- Replacement: `gemini-3.5-flash-lite` | Shutdown date: October 20, 2026 Replacement: `gemini-3.5-flash-lite` |

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `gemini-2.0-flash-001` <br /> Release date: February 5, 2025 Release stage: Shutdown | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` |
| `gemini-2.0-flash` <br /> Release date: February 10, 2025 Release stage: Shutdown | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` |
| `gemini-2.0-flash-lite-001` <br /> Release date: February 25, 2025 Release stage: Shutdown | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` |
| `gemini-2.0-flash-lite` <br /> Release date: February 25, 2025 Release stage: Shutdown | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` | Shutdown date: June 1, 2026 Replacement: `gemini-3.5-flash-lite` |

^**1** *For the Agent Platform Gemini API (formerly Vertex AI), this is a
"short-term availability model". See
[Model versioning and naming patterns](https://firebase.google.com/docs/ai-logic/models.md.txt#versions)*^

^All the following general-use models are also shutdown:
`gemini-1.0-pro`,
`gemini-1.0-pro-001`,
`gemini-1.0-pro-002`,
`gemini-1.0-pro-vision`,
`gemini-1.0-pro-vision-001`
`gemini-1.5-flash-001`,
`gemini-1.5-flash`,
`gemini-1.5-flash-002`,
`gemini-1.5-pro-001`,
`gemini-1.5-pro`,
`gemini-1.5-pro-002`^

##### Image-generating (Nano Banana and Imagen) models

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `gemini-2.5-flash-image` <br /> Release date: October 2, 2025 Release stage: Shutdown | Shutdown date: October 2, 2026 Replacement: `gemini-nano-banana-2.1` | Shutdown date: October 2, 2026 Replacement: `gemini-nano-banana-2.1` |

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `imagen-4.0-generate-001` <br /> Release date: August 14, 2025 Release stage: Shutdown | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |
| `imagen-4.0-fast-generate-001` <br /> Release date: August 14, 2025 Release stage: Shutdown | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |
| `imagen-4.0-ultra-generate-001` <br /> Release date: August 14, 2025 Release stage: Shutdown | Shutdown date: June 30, 2026 Replacement: `gemini-3-pro-image` | Shutdown date: June 30, 2026 Replacement: `gemini-3-pro-image` |
| `imagen-3.0-capability-001` <br /> Release date: December 10, 2024 Release stage: Shutdown | *Not supported* | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |
| `imagen-3.0-generate-002` <br /> Release date: January 23, 2025 Release stage: Shutdown | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |
| `imagen-3.0-generate-001` <br /> Release date: July 31, 2024 Release stage: Shutdown | *Not supported* | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |
| `imagen-3.0-fast-generate-001` <br /> Release date: July 31, 2024 Release stage: Shutdown | *Not supported* | Shutdown date: June 30, 2026 Replacement: `gemini-nano-banana-2.1` |

##### Audio - Live API models

| **Model** | **Gemini Developer API** | **Agent Platform Gemini API** |
|---|---|---|
| `gemini-live-2.5-flash-preview` <br /> Release date: June 17, 2025 Release stage: Shutdown | Shutdown date: December 9, 2025 Replacement: `gemini-3.1-flash-live-preview` | Shutdown date: December 9, 2025 Replacement: `gemini-live-2.5-flash-native-audio` |
| `gemini-2.0-flash-live-001` <br /> Release date: April 9, 2025 Release stage: Shutdown | Shutdown date: December 9, 2025 Replacement: `gemini-3.1-flash-live-preview` | Shutdown date: December 9, 2025 Replacement: `gemini-live-2.5-flash-native-audio` |
| `gemini-2.0-flash-live-preview-04-09` <br /> Release date: April 9, 2025 Release stage: Shutdown | *Not supported* | Shutdown date: December 9, 2025 Replacement: `gemini-live-2.5-flash-native-audio` |

<br />

<br />


#### Changes required when models are deprecated or shut down (retired)

<br />

#### Where to find the shutdown date of a model?

Here are some ways you can find the shutdown date of a model:

- Google sends emails to appropriate project members.

- We post announcements and reminders about upcoming shutdowns in various
  channels:

  - Release notes (see [example](https://firebase.google.com/support/releases.md.txt#gemini-older-flash-models-deprecated))
  - Page-level banners in the docs, the [supported models page](https://firebase.google.com/docs/ai-logic/models.md.txt#available-model-names), and the [deprecated and shutdown models FAQ](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#shutdown-models-list)

#### What to do if the model you're using is about to be shut down?

You need to make these changes *before the shutdown date*; otherwise, any
requests to a shutdown model will fail with a 404 error.

1. Find a suitable [currently supported model](https://firebase.google.com/docs/ai-logic/models.md.txt) and its
   [model name](https://firebase.google.com/docs/ai-logic/models.md.txt#available-model-names).

   We also provide recommended replacement models in the
   [deprecated and shutdown models FAQ](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#shutdown-models-list).
2. Update the model name used by your app.

   You set the model name during initialization when you
   [create a `GenerativeModel`, `LiveModel`, or `ImagenModel` instance](https://firebase.google.com/docs/ai-logic/get-started.md.txt#initialize-service-and-model).
   Make sure to review the critical recommendation below about using
   Firebase Remote Config or server prompt templates.
3. Check if you need to update any of your code.

   You *usually* don't need to modify any of the code which actually calls the
   model. Here are some exceptions:
   - **Unsupported sampling parameters** : The latest Gemini 4.x and
     Gemini 3.x models,
     [several parameters are unsupported](https://firebase.google.com/docs/ai-logic/model-parameters.md.txt#unsupported-parameters)
     (specifically temperature, top-K, top-P, frequency penalty,
     presence penalty, and candidate count).

   - **Thinking level vs Thinking budget** : Starting with Gemini 3.x
     models, you should use `thinkingLevel` instead of `thinkingBudget` (but
     `thinkingBudget` is still supported for backwards-compatibility).
     However, starting with Gemini 4.x models, `thinkingBudget` is
     ***not*** supported.
     Learn more about
     [thinking](https://firebase.google.com/docs/ai-logic/thinking.md.txt#control-thinking-amount).

   - **Experiment with thinking level value** : When you upgrade to a new
     generation (for example, 2.5 to 3.8) and you want to ensure the same
     performance and behavior (for example, latency), we recommend
     experimenting with setting the thinking level to a lower value.
     Learn more about
     [thinking](https://firebase.google.com/docs/ai-logic/thinking.md.txt#control-thinking-amount).

4. Test your app to ensure that responses are still as expected.

> [!CAUTION]
> Because requests fail for models that have been shutdown, **we strongly recommend that you do *not* hard-code model names
> into your app's codebase. Instead, use
> [Firebase Remote Config](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)
> or
> [server prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started.md.txt)
> to control the model name used for your AI feature.**
>
>
> With Remote Config and server prompt templates, you can dynamically and
> *remotely* change the model name used for your AI feature without
> releasing a new version of your app. Any already released versions of your
> app (that are configured to use Remote Config or server prompt
> templates) will immediately start using the new model.

<br />

<br />

<br />

#### Changes required for the rebranding of "Vertex AI" to "Agent Platform"

<br />

In mid-2026, Google Cloud rebranded "Vertex AI" to
"Gemini Enterprise Agent Platform" (or "Agent Platform"). In the Firebase
ecosystem, we refer to this service as the "Agent Platform Gemini API".

For Google Cloud, this rebranding included the following. Note that there were
other changes, but they aren't applicable to Firebase AI Logic.

- Rebranding the product from "Vertex AI" to "Gemini Enterprise Agent Platform"
  (or "Agent Platform"), which includes new URLs for the Google Cloud console
  and documentation.

- Changing the *display name* of the API from "Vertex AI API" to
  "Agent Platform API". Note that the *service name* has stayed the same:
  [`aiplatform.googleapis.com`](https://console.cloud.google.com/apis/library/aiplatform.googleapis.com?project=_).

- Rebranding "Vertex AI Studio" to "Agent Studio".

- No changes to the capabilities of the underlying APIs or supported models.

**For the Firebase AI Logic SDKs, we accommodated this rebranding by
updating the *initialization syntax* for the "Gemini API" backend service
and updating the
[*default location* for accessing the model](https://firebase.google.com/docs/ai-logic/locations.md.txt?api=vertex)
when using this new syntax.**

- **New initialization syntax for the "Gemini API" backend service:**

  ### Swift

  Change `vertexAI` to `agentPlatform`.
  - The `agentPlatform` syntax is available starting with v12.17.0+ of the SDK.
  - The `vertexAI` syntax was removed in v13.0.0 of the SDK.

  **BEFORE**

  ```swift
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `vertexAI` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  let ai = FirebaseAI.firebaseAI(backend: .vertexAI(location: "LOCATION"))

  // ...
  ```

  **AFTER**

  ```swift
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the `agentPlatform` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  let ai = FirebaseAI.firebaseAI(backend: .agentPlatform(location: "LOCATION"))

  // ...
  ```

  ### Kotlin

  Change `vertexAI` to `agentPlatform`.
  - The `agentPlatform` syntax is available starting with v17.15.0+ of the SDK and v34.17.0+ of the Firebase Android BoM.
  - The `vertexAI` syntax was removed in v18.0.0 of the SDK and v35.0.0 of the BoM.

  **BEFORE**

  ```kotlin
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `vertexAI` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  val ai = Firebase.ai(backend = GenerativeBackend.vertexAI(location = "LOCATION"))

  // ...
  ```

  **AFTER**

  ```kotlin
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the `agentPlatform` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  val ai = Firebase.ai(backend = GenerativeBackend.agentPlatform(location = "LOCATION"))

  // ...
  ```

  ### Java

  Change `vertexAI` to `agentPlatform`.
  - The `agentPlatform` syntax is available starting with v17.15.0+ of the SDK and v34.17.0+ of the Firebase Android BoM.
  - The `vertexAI` syntax was removed in v18.0.0 of the SDK and v35.0.0 of the BoM.

  **BEFORE**

  ```java
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `vertexAI` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.vertexAI("LOCATION"));

  // ...
  ```

  **AFTER**

  ```java
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the `agentPlatform` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  GenerativeModel ai = FirebaseAI.getInstance(GenerativeBackend.agentPlatform("LOCATION"));

  // ...
  ```

  ### Web

  Change `VertexAIBackend` to `AgentPlatformBackend`.
  - The `AgentPlatformBackend` syntax is available starting with v12.17.0+ of the Firebase JS SDK.
  - The `VertexAIBackend` syntax was removed in v13.0.0 of the SDK.

  **BEFORE**

  ```javascript
  import { getAI, getGenerativeModel, VertexAIBackend } from "firebase/ai";

  // ...

  // Initialize FirebaseApp

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `VertexAIBackend` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  const ai = getAI(firebaseApp, { backend: new VertexAIBackend('LOCATION') });

  // ...
  ```

  **AFTER**

  ```javascript
  import { getAI, getGenerativeModel, AgentPlatformBackend } from "firebase/ai";

  // ...

  // Initialize FirebaseApp

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the `AgentPlatformBackend` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  const ai = getAI(firebaseApp, { backend: new AgentPlatformBackend('LOCATION') });

  // ...
  ```

  ### Dart

  Change `vertexAI` to `agentPlatform`.
  - The `agentPlatform` syntax is available starting with v3.15.0+ of the plugin and v4.18.0+ of the Firebase Flutter BoM.
  - The `vertexAI` syntax was removed in v5.0.0 of the plugin and v5.0.0+ of the Firebase Flutter BoM.

  **BEFORE**

  ```dart
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `vertexAI` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  final ai = await FirebaseAI.vertexAI(location: 'LOCATION');

  // ...
  ```

  **AFTER**

  ```dart
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the `agentPlatform` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  final ai = await FirebaseAI.agentPlatform(location: 'LOCATION');

  // ...
  ```

  ### Unity

  Change `VertexAI` to `AgentPlatform`.
  - The `AgentPlatform` syntax is available starting with Firebase SDK for Unity v13.15.0+.
  - The `VertexAI` syntax was removed in v14.0.0 of the SDK.

  **BEFORE**

  ```c#
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly branded Vertex AI).
  // For the legacy `VertexAI` syntax, the default location is `us-central1`, so
  // specifying a location is usually required since most models are *not* supported in `us-central1`.
  var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.VertexAI(location: "LOCATION"));

  // ...
  ```

  **AFTER**

  ```c#
  // ...

  // Initialize the Agent Platform Gemini API backend service (formerly Vertex AI).
  // For the `AgentPlatform` syntax, the default location is `global`, so
  // specifying a location is usually optional since most models are supported in `global`.
  var ai = FirebaseAI.GetInstance(FirebaseAI.Backend.AgentPlatform(location: "LOCATION"));

  // ...
  ```
- **New default location for accessing the model when using the new
  initialization syntax:**

  When using the new "Agent Platform" initialization syntax, the location
  defaults to `global`.

  This change was made because almost all Gemini models are supported
  in `global`, and Google Cloud is no longer supporting the `us-central1`
  location for new releases of most Gemini models.

> [!WARNING]
> **Warning:** As of mid-October 2026, the legacy "Vertex AI" initialization syntax has been removed in the latest breaking change releases for the SDKs. In older SDK versions where the legacy "Vertex AI" syntax is still available, it gives you access to the same "Gemini API" provider (now branded as "Agent Platform") and it defaults to the `us-central1` location.  
>
> We recommend that you migrate your apps as soon as possible to use the new "Agent Platform" initialization syntax.  
>
> Note that any version of your app that uses the legacy syntax along with an older SDK version will continue to run and will *not* break due to use of the legacy initialization syntax.

<br />

<br />

<br />

#### For Swift apps - Changes required to migrate from `FirebaseAI` to `FirebaseAILogic`

<br />

For Apple platform apps, starting with Firebase SDK v12.5.0,
Firebase AI Logic is distributed under the `FirebaseAILogic` module. In SDK
v13.0.0, the `FirebaseAI` module was removed.

> [!NOTE]
> **Note:** This FAQ applies if you're currently using the `FirebaseAI` module and you upgrade to v12.5.0+ of the Firebase SDK. If you're using the legacy `FirebaseVertexAI` module, then visit our [migration guide](https://firebase.google.com/docs/ai-logic/migrate-to-latest-sdk.md.txt).

#### Why did we make this change?

We formerly distributed this service under the `FirebaseAI` module. However, we
needed to rename it to `FirebaseAILogic` for the following reasons:

- Avoid a name collision between module and class that causes issues in binary
  distributions.

- Enable us to use Swift macros for future feature development.

#### What to do if you're upgrading to v12.5.0+ or v13.0.0+?

In Firebase 12 (starting with v12.5.0+), the module name change to
`FirebaseAILogic` is non-breaking and backward-compatible, so these changes are
*recommended* in Firebase 12. However, in Firebase SDK v13.0.0, the old
`FirebaseAI` module was removed, so these changes are ***required*** when
upgrading to Firebase 13.

1. When choosing Swift PM dependencies, choose `FirebaseAILogic` (instead of
   `FirebaseAI`).

2. Change import statements to `FirebaseAILogic` (instead of `FirebaseAI`).

<br />

<br />

<br />

#### Understand the name change from "Vertex AI in Firebase" to "Firebase AI Logic"

<br />

Back in 2024, we launched a set of Firebase client SDKs that could use the
Agent Platform Gemini API (formerly Vertex AI) as well as a Firebase proxy gateway to protect that
API from abuse and to enable integrations with other Firebase products. We
called our product "Vertex AI in Firebase", and this product name accurately
described our product's available use cases at that time.

Since then, though, we've expanded the capabilities of our product. For example,
as of May 2025, we now offer support for the Gemini Developer API,
including the ability to protect the Gemini Developer API from abuse
using our integration with Firebase App Check.

As a result, the name "Vertex AI in Firebase" no longer accurately represents
the expanded scope of our product. Thus, **a new name --- Firebase AI Logic ---
better reflects our evolving feature set and allows us to continue to expand our
offerings in the future!**

Check out the [migration guide](https://firebase.google.com/docs/ai-logic/migrate-to-latest-sdk.md.txt)
to make sure you get all the latest features from Firebase AI Logic (and
optionally start using the Gemini Developer API).

> [!NOTE]
> **Note:** In mid-2026, the "Vertex AI" service itself was renamed "Gemini Enterprise Agent Platform" (or "Agent Platform). [Learn more.](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#changes-for-vertexai-rebrand-to-agent-platform)

<br />

<br />

<br />

*** ** * ** ***

## Security FAQ

The following sections contain FAQs related to security, for example about
App Check or about Gemini API keys.

*** ** * ** ***

### FAQs about Firebase App Check

> [!WARNING]
> **Warning** : **Starting
> November 2, 2026, Firebase App Check enforcement will be
> *required* to use Firebase AI Logic.**
>
>
> Starting on **November 2, 2026**, the following
> will happen:
>
> - App Check will be automatically enforced for Firebase AI Logic in your Firebase project (if it's not already enforced).
> - Any requests to Firebase AI Logic without a valid App Check token will be blocked. This includes released app versions that don't have a production attestation provider implemented.
>
>
> ***Before November 2, 2026*** , it's
> critical that you work towards
> [implementing and enforcing
> App Check for your already released apps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting#app-check-for-already-released-app).
>
>
> Note that you can temporarily delay the automatic enforcement of
> App Check (in the Firebase console, go to the
> **Security** \> **App Check** \>
> [**APIs** tab](https://console.firebase.google.com/project/_/appcheck/apps/products/?useAutoProject=true)).
> Be aware that if you delay auto-enforcement and choose not to enforce
> App Check for Firebase AI Logic, then access to the Gemini API
> is vulnerable to abuse. Also, this delay is only temporary --- after
> January 21, 2027, delaying auto-enforcement of
> App Check for Firebase AI Logic won't be possible.
>
>
> [Learn more about App Check enforcement for Firebase AI Logic.](https://firebase.google.com/docs/ai-logic/app-check.md.txt)

<br />

#### Required App Check enforcement for all versions of an app

<br />

App Check needs to be enforced for all versions of your app that use
Firebase AI Logic.

It's critical that App Check is enforced as early as possible --- especially
before you commit your app to a publicly available source code control system,
share your app, or make your app publicly available.

If you implement App Check in your app's codebase right away, then all your
app versions can send valid App Check tokens. A request that doesn't send a
valid token is considered unverified and will be blocked when App Check is
enforced.

If you've already released a version of your app to end-users that does *not*
have App Check implemented, see the FAQ about how to
[implement and enforce App Check for an already released app](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#app-check-for-already-released-app).

<br />

<br />

<br />

#### Delay auto-enforcement of App Check for Firebase AI Logic

<br />

Starting November 2, 2026, Firebase will automatically enforce
Firebase App Check for Firebase AI Logic in your Firebase project (if
it's not already enforced).

When App Check is enforced, any requests to Firebase AI Logic without a
valid App Check token will be blocked. This includes released app versions
that don't have a production attestation provider implemented.

If you have released app versions that don't have App Check implemented,
then you can temporarily delay automatic enforcement of App Check for
Firebase AI Logic. **However, *before
January 21, 2027,* it's critical that you work towards
[implementing and enforcing App Check for your already released apps](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#app-check-for-already-released-app).**

Here's how to delay the auto-enforcement of App Check for
Firebase AI Logic:

1. In the Firebase console, go to the **Security** \> **App Check** \>
   [**APIs** tab](https://console.firebase.google.com/project/_/appcheck/apps/products/?useAutoProject=true).

2. Find the row for **Firebase AI Logic**.

3. At the end of the row, find the **Enforces:** date picker with its
   Edit icon.

4. Select the date that you want App Check to be automatically
   enforced for Firebase AI Logic.

   The last possible date is January 21, 2027. After
   that date, you can't delay auto-enforcement of App Check for
   Firebase AI Logic.
5. Click **Save**.

> [!WARNING]
> **Warning:** Be aware that if you delay auto-enforcement and choose not to enforce App Check for Firebase AI Logic, then access to the Gemini API is vulnerable to abuse. Also, this delay is only temporary --- after January 21, 2027, delaying auto-enforcement of App Check for Firebase AI Logic won't be possible.

<br />

<br />

<br />

#### How to implement and enforce App Check for an app that's already released

<br />

For app versions that don't have App Check implemented, requests to
Firebase AI Logic from those versions don't have valid App Check tokens
and are considered unverified. These requests will be blocked when App Check
is enforced for Firebase AI Logic.

> [!WARNING]
> **Warning:** **Starting November 2, 2026, App Check enforcement
> for Firebase AI Logic will be required.**   
> On this date, we'll automatically enforce App Check for Firebase AI Logic. Note that you can temporarily delay auto-enforcement until January 21, 2027 (learn how to delay auto-enforcement in the instructions below).   
>
> If you have end-users on app versions that don't have App Check implemented, then requests from those users will be blocked starting November 2, 2026. Thus, it's critical that you migrate these end-users to app versions with App Check implemented as soon as possible.   
>
> [Learn more about this requirement.](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-app-check)

The following instructions help you migrate your app so that you can enforce
App Check in a way that avoids service disruptions for an already released
app that doesn't have App Check.

1. Delay automatic enforcement of App Check for Firebase AI Logic:

   1. In the Firebase console, go to the **Security** \> **App Check** \>
      [**APIs** tab](https://console.firebase.google.com/project/_/appcheck/apps/products/?useAutoProject=true).

   2. Find the row for **Firebase AI Logic**.

   3. At the end of the row, find the **Enforces:** date picker with its
      Edit icon.

   4. Select the date that you want App Check to be automatically
      enforced for Firebase AI Logic.

      The last possible date is January 21, 2027.
      After that date, you can't delay auto-enforcement of App Check for
      Firebase AI Logic.
   5. Click **Save**.

   > [!WARNING]
   > **Warning:** Be aware that if you delay auto-enforcement and choose not to enforce App Check for Firebase AI Logic, then access to the Gemini API is vulnerable to abuse. Also, this delay is only temporary --- after January 21, 2027, delaying auto-enforcement of App Check for Firebase AI Logic won't be possible.

2. Implement a *production attestation provider* in your app as soon as
   possible.

   - **Apple platforms** : [DeviceCheck](https://firebase.google.com/docs/app-check/ios/devicecheck-provider.md.txt) or [App Attest](https://firebase.google.com/docs/app-check/ios/app-attest-provider.md.txt) or [reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/ios/recaptcha-enterprise-provider.md.txt)
   - **Android** : [Play Integrity](https://firebase.google.com/docs/app-check/android/play-integrity-provider.md.txt) or [reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/android/recaptcha-enterprise-provider.md.txt)
   - **Web** : [reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/web/recaptcha-enterprise-provider.md.txt)
   - **Flutter** : Supports [all the providers above](https://firebase.google.com/docs/app-check/flutter/default-providers.md.txt), including [reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/flutter/recaptcha-enterprise-provider.md.txt)
   - **Unity** : Supports [all the providers above](https://firebase.google.com/docs/app-check/unity/default-providers.md.txt) (support for reCAPTCHA Enterprise is coming soon)

   > [!NOTE]
   > **Note:** When you implement App Check, consider enabling usage of limited-use tokens so that you have the option later of [enhanced protection using *replay protection*](https://firebase.google.com/docs/ai-logic/app-check.md.txt#replay-protection), which means an App Check token can only be used once.

3. [Monitor the requests from your app](https://firebase.google.com/docs/app-check/monitor-metrics.md.txt) to
   help you decide when it's safe to enforce App Check.

   For example, if almost all of the recent requests are from verified clients,
   then you should consider enforcing App Check.
4. [Enforce App Check for Firebase AI Logic.](https://firebase.google.com/docs/ai-logic/app-check.md.txt#enforce-app-check)

   > [!WARNING]
   > **Warning:** If you haven't enforced App Check for Firebase AI Logic by November 2, 2026, it will be *automatically* enforced. [Learn more.](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-app-check)

5. For **local development** when App Check is enforced, you can
   [set up the App Check *debug provider*](https://firebase.google.com/docs/ai-logic/app-check.md.txt#configure-debug-provider)
   and still keep App Check enforced for Firebase AI Logic.

<br />

<br />

*** ** * ** ***

### FAQs about the Gemini API key

> [!NOTE]
> **Important** : Starting in mid-2026, Firebase AI Logic handles authorization of requests for both the Gemini Developer API and the Agent Platform Gemini API (formerly Vertex AI) using a Google-managed service account (P4SA) that we automatically provision for you in your Firebase project:  
> *Firebase AI Logic Service Agent* (`service-PROJECT_ID@gcp-sa-firebasevertexai.iam.gserviceaccount.com`)
>
>
> Firebase AI Logic no longer uses standard Gemini API keys for
> authorizing use of the Gemini Developer API.

<br />

#### Understand the security upgrades (mid-2026) for the Gemini Developer API and Firebase AI Logic

<br />

Historically, the Gemini Developer API relied on standard
Gemini API keys for authorizing use of the
Gemini Developer API
([`generativelanguage.googleapis.com`](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_)).
If you enabled Firebase AI Logic and chose to use the
Gemini Developer API, then Firebase created a Gemini API key
for you that was restricted to the Gemini Developer API.
This key was named
`Gemini Developer API key (auto created by Firebase)`.

Starting in mid-2026, the Gemini Developer API is upgrading to a more
secure alternative called
["Authorization (auth) keys"](https://ai.google.dev/gemini-api/docs/api-key)
(which are essentially service accounts). Firebase AI Logic has upgraded in
tandem. Instead of using a standard Gemini API key,
**Firebase AI Logic now handles authorization for the
Gemini Developer API using a Google-managed service account (P4SA) that
we automatically provision for you** :  

*Firebase AI Logic Service Agent*
(`service-PROJECT_ID@gcp-sa-firebasevertexai.iam.gserviceaccount.com`)

For both existing and new projects, **if you access the
Gemini Developer API via Firebase AI Logic, no action is needed on
your part to take advantage of these security upgrades from mid-2026.**

> [!IMPORTANT]
> **Important:** To help secure against abuse of the Gemini API when using Firebase AI Logic, it's ***critical*** that you [enforce Firebase App Check](https://firebase.google.com/docs/ai-logic/app-check.md.txt) as early as possible --- especially before you commit your app to a publicly available source code control system, share your app, or make your app publicly available.

<br />

<br />

<br />

#### How to migrate a Gemini API key to an "Authorization (auth) key"

<br />

For both existing and new projects, **if you access the
Gemini Developer API via Firebase AI Logic, no action is needed on
your part to take advantage of security upgrades from mid-2026** (including
migrating to an "Authorization (auth) key").

On behalf of our developers, Firebase AI Logic is automatically handling all
the required security changes to accommodate the transition of the
Gemini Developer API to require "Authorization (auth) keys".

Starting in mid-2026, Firebase AI Logic no longer provisions or uses
standard Gemini API keys. Instead, Firebase AI Logic now handles
authorization for the Gemini Developer API using a
Google-managed service account (P4SA) that we automatically provision for you in
your Firebase project:  

*Firebase AI Logic Service Agent*
(`service-PROJECT_ID@gcp-sa-firebasevertexai.iam.gserviceaccount.com`)

<br />


Given this change, you can review and delete any API key named
`Gemini Developer API key (auto created by Firebase)`.
You can delete this key in the
[Google Cloud console](https://console.cloud.google.com/apis/credentials). Review the following
*before* deleting the key:

- This Gemini API key was created by Firebase for the sole purpose of using with Firebase AI Logic, so it should be safe to delete. However, before you delete this key, you should still check to make sure that you haven't erroneously used the key with other tools that can give access to the Gemini Developer API, like the GenAI server SDKs or Genkit. Here's how to check the usage:
  1. In the Google Cloud console, go to the page for the [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_), then click **Manage**.
  2. In the **Metrics** tab, in the **Credentials** dropdown, select the key named `Gemini Developer API key (auto created by Firebase)`.
  3. If the displayed graphs show no usage since early July 2026 (which was when Firebase AI Logic stopped using these API keys), then the key is safe to delete.  
     However, if the graphs show usage, then you're using the key with another tool and you should [rename the key](https://docs.cloud.google.com/docs/authentication/api-keys) so that it's clear that it's being used with that tool (and *not* with Firebase AI Logic).
- Make sure that you **do *not* delete any other API key with a
  name that contains the segment
  `(auto created by Firebase)`**.

<br />

> [!NOTE]
> **Note:** Until late-July 2026, Firebase still created a standard restricted Gemini API key when you enabled the Gemini Developer API for use with Firebase AI Logic. We did this for backwards compatibility and to be rollback-safe during this transition period. After late-July 2026, we no longer create these standard Gemini API keys (instead, we'll *only* provision the Google-managed service account (P4SA) described above).

<br />

<br />

<br />

#### Do *not* add a Gemini API key into a mobile or web app's codebase

<br />

> [!WARNING]
> Firebase AI Logic has rolled out [security upgrades (mid-2026) for the Gemini Developer API](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-upgrades-mid-2026-dev-api). In short, Firebase AI Logic no longer uses standard Gemini API keys to authorize use of the Gemini Developer API; instead, we now handle authorization using a Google-managed service account (P4SA) that we automatically provision for you.
>
>
> Given this change, you can review and delete any API key named
> `Gemini Developer API key (auto created by Firebase)`.
> You can delete this key in the
> [Google Cloud console](https://console.cloud.google.com/apis/credentials). Review the following
> *before* deleting the key:
>
> - This Gemini API key was created by Firebase for the sole purpose of using with Firebase AI Logic, so it should be safe to delete. However, before you delete this key, you should still check to make sure that you haven't erroneously used the key with other tools that can give access to the Gemini Developer API, like the GenAI server SDKs or Genkit. Here's how to check the usage:
>   1. In the Google Cloud console, go to the page for the [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_), then click **Manage**.
>   2. In the **Metrics** tab, in the **Credentials** dropdown, select the key named `Gemini Developer API key (auto created by Firebase)`.
>   3. If the displayed graphs show no usage since early July 2026 (which was when Firebase AI Logic stopped using these API keys), then the key is safe to delete.  
>      However, if the graphs show usage, then you're using the key with another tool and you should [rename the key](https://docs.cloud.google.com/docs/authentication/api-keys) so that it's clear that it's being used with that tool (and *not* with Firebase AI Logic).
> - Make sure that you **do *not* delete any other API key with a
>   name that contains the segment
>   `(auto created by Firebase)`**.

When using the Firebase AI Logic SDKs, you do ***not*** need a
Gemini API key for authorizing use of the Gemini Developer API,
and you should ***not*** add a Gemini API key into your app's codebase.

<br />

<br />

<br />

#### Do *not* use a "Firebase API key" as a Gemini API key

<br />

> [!WARNING]
> Firebase AI Logic has rolled out [security upgrades (mid-2026) for the Gemini Developer API](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-upgrades-mid-2026-dev-api). In short, Firebase AI Logic no longer uses standard Gemini API keys to authorize use of the Gemini Developer API; instead, we now handle authorization using a Google-managed service account (P4SA) that we automatically provision for you.
>
>
> Given this change, you can review and delete any API key named
> `Gemini Developer API key (auto created by Firebase)`.
> You can delete this key in the
> [Google Cloud console](https://console.cloud.google.com/apis/credentials). Review the following
> *before* deleting the key:
>
> - This Gemini API key was created by Firebase for the sole purpose of using with Firebase AI Logic, so it should be safe to delete. However, before you delete this key, you should still check to make sure that you haven't erroneously used the key with other tools that can give access to the Gemini Developer API, like the GenAI server SDKs or Genkit. Here's how to check the usage:
>   1. In the Google Cloud console, go to the page for the [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_), then click **Manage**.
>   2. In the **Metrics** tab, in the **Credentials** dropdown, select the key named `Gemini Developer API key (auto created by Firebase)`.
>   3. If the displayed graphs show no usage since early July 2026 (which was when Firebase AI Logic stopped using these API keys), then the key is safe to delete.  
>      However, if the graphs show usage, then you're using the key with another tool and you should [rename the key](https://docs.cloud.google.com/docs/authentication/api-keys) so that it's clear that it's being used with that tool (and *not* with Firebase AI Logic).
> - Make sure that you **do *not* delete any other API key with a
>   name that contains the segment
>   `(auto created by Firebase)`**.

**Never use your "Firebase API key" as a Gemini API key.** We strongly
recommend that you do ***not*** add the Gemini Developer API to the
allowlist for your Firebase API key.

Your Firebase API key is the API key that's listed in your
Firebase configuration file or object that you add into your app's codebase to
connect your app to Firebase. **It's OK to include your Firebase API key in your
code *when you use the key only with Firebase-related APIs
(like Firebase AI Logic)*.**
[Learn important information about Firebase API keys](https://firebase.google.com/docs/projects/api-keys.md.txt).

In the
[*APIs \& Services* \> *Credentials* panel](https://console.cloud.google.com/apis/credentials?project=_)
of the Google Cloud console, this is what Firebase API keys look like:

![API keys automatically created by Firebase for your Firebase Apps](https://firebase.google.com/static/docs/projects/images/api-keys-from-firebase-cloud-console.png)

Because you need to add your Firebase API key into your app's codebase for
Firebase-related APIs to work, and because the Gemini Developer API can
be *authorized* via API key, **we strongly recommend that you do NOT add the
Gemini Developer API (called the "Generative Language API" in the
Google Cloud console) to the API allowlist for your Firebase API key** . If you
do, then you're exposing the Gemini Developer API to potential abuse.

<br />

<br />

<br />

#### How to keep a Gemini API key secure

<br />

> [!WARNING]
> Firebase AI Logic has rolled out [security upgrades (mid-2026) for the Gemini Developer API](https://firebase.google.com/docs/ai-logic/faq-and-troubleshooting.md.txt#security-upgrades-mid-2026-dev-api). In short, Firebase AI Logic no longer uses standard Gemini API keys to authorize use of the Gemini Developer API; instead, we now handle authorization using a Google-managed service account (P4SA) that we automatically provision for you.
>
>
> Given this change, you can review and delete any API key named
> `Gemini Developer API key (auto created by Firebase)`.
> You can delete this key in the
> [Google Cloud console](https://console.cloud.google.com/apis/credentials). Review the following
> *before* deleting the key:
>
> - This Gemini API key was created by Firebase for the sole purpose of using with Firebase AI Logic, so it should be safe to delete. However, before you delete this key, you should still check to make sure that you haven't erroneously used the key with other tools that can give access to the Gemini Developer API, like the GenAI server SDKs or Genkit. Here's how to check the usage:
>   1. In the Google Cloud console, go to the page for the [Gemini Developer API](https://console.cloud.google.com/apis/library/generativelanguage.googleapis.com?project=_), then click **Manage**.
>   2. In the **Metrics** tab, in the **Credentials** dropdown, select the key named `Gemini Developer API key (auto created by Firebase)`.
>   3. If the displayed graphs show no usage since early July 2026 (which was when Firebase AI Logic stopped using these API keys), then the key is safe to delete.  
>      However, if the graphs show usage, then you're using the key with another tool and you should [rename the key](https://docs.cloud.google.com/docs/authentication/api-keys) so that it's clear that it's being used with that tool (and *not* with Firebase AI Logic).
> - Make sure that you **do *not* delete any other API key with a
>   name that contains the segment
>   `(auto created by Firebase)`**.

<br />

<br />

<br />

[Give feedback
about your experience with Firebase AI Logic](https://firebase.google.com/docs/ai-logic/feedback)

<br />