Sitelet https://github.com/angular/angularfire/issues/3686
Skip to content

Using Firebase Logic AI #3686

Closed as not planned
Closed as not planned

Description

@JGSolutions

Trying to use the new gemini-3-pro-preview but for some reason it's always point to the vertex api giving me a 403

This my app.config
provideAI(() => getAI(getApp(), { backend: new GoogleAIBackend() })),

In my firebase console i enabled it to use gemini api. Does GoogleAIBackend use the proper endpoint?

Activity

  1. JGSolutions commented on Dec 12, 2025

    @JGSolutions
    Author

    here is the js 403 error I get:

    https://firebasevertexai.googleapis.com/v1beta/projects/board-games-315b9/models/gemini-3-pro-preview:streamGenerateContent?alt=sse: [403 ] Requests to this API firebasevertexai.googleapis.com method google.firebase.vertexai.v1beta.GenerativeService.StreamGenerateContent are blocked.

    I know I have to enable the vertex i don't want to. I want to use the Gemini

  2. gui-complypro commented on Dec 18, 2025

    @gui-complypro

    Preview models are only available in the global region.

    //https://firebase.google.com/docs/ai-logic/models#available-model-names
    const vertexAI = getAI(firebaseApp, { backend: new VertexAIBackend('global') });
    this.model = getGenerativeModel(vertexAI, {
      model: 'gemini-3-flash-preview',
      systemInstruction: systemPrompt,
    });
  3. added
    type: featureNew capability or enhancement.
    comp: aiFirebase AI Logic / Vertex AI (src/ai).
    triaged: keep-openTriaged and intentionally kept open; exempt from any future stale process.
    on Aug 3, 2026
  4. KingDarBoja commented on Oct 27, 2026

    @KingDarBoja
    Contributor

    This should be fixed already with latest AngularFire version (v21).

  5. armando-navarro commented on Nov 5, 2026

    @armando-navarro
    Collaborator

    Thanks for the report, and thanks @gui-complypro for the note about preview models.

    To answer the question in the issue: yes, GoogleAIBackend selects the Gemini Developer API.

    • In the Firebase JS SDK both backends send their requests to the firebasevertexai.googleapis.com host, and the backend only changes the path.
    • The Gemini Developer API path is projects/{project}/models/{model}, which is the path in your error. The Vertex AI path adds a locations/{location} segment.
    • AngularFire passes your getAI options to the SDK unchanged, so the backend you asked for is the one in effect.

    That makes the 403 a project setting rather than a backend mix-up. Firebase's AI Logic error-codes page lists this exact message, "Requests to this API firebasevertexai.googleapis.com ... are blocked", under API key restrictions:

    • The API key in your app's Firebase config excludes the Firebase AI Logic API.
    • The fix is in the Google Cloud console under APIs & Services, Credentials: add the Firebase AI Logic API to that key's API restrictions. It can take a few minutes to apply.
    • The Gemini Developer API does not need Vertex AI and runs on the Spark plan. Preview models such as gemini-3-pro-preview need the Blaze plan, whichever provider you use.

    AngularFire 21.0.0 ships @angular/fire/ai with provideAI, getAI and both backends, and the AI Logic guide covers the setup: https://github.com/angular/angularfire/blob/21.0.x/docs/ai.md

    I'm closing this since there is nothing for AngularFire to change here. If fixing the key restriction does not clear the 403, please open a new issue with the request URL and the key settings, and I'll take another look.

  6. removed
    triaged: keep-openTriaged and intentionally kept open; exempt from any future stale process.
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp: aiFirebase AI Logic / Vertex AI (src/ai).type: featureNew capability or enhancement.version: current (v17+)Targets the current modular API (v17+).

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions