skill

Firebase AI Logic Basics

Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.

firebase138,127+ installsVetted

About

# Firebase AI Logic Basics

## Overview

Firebase AI Logic is a product of Firebase that allows developers to add gen AI to their mobile and web apps using client-side SDKs. The app can directly call Gemini models via Firebase AI Logic without the developer needing to manage a dedicated backend. Firebase AI Logic was previously known as "Vertex AI for Firebase".

It supports the two Gemini API providers:

- **Gemini Developer API**: It has a free tier ideal for prototyping, and pay-as-you-go for production - **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale with enterprise-grade production readiness, requires Blaze pricing plan

Use the Gemini Developer API as a default, and only Agent Platform Gemini API (formerly branded Vertex AI) if the application requires it.

______________________________________________________________________

## Setup & initialization

### Prerequisites

- Identify the platform the user is interested in building on prior to starting: Android, iOS, Web, or Flutter. - If their platform is unsupported, Direct the user to Firebase Docs to learn how to set up AI Logic for their application (share this link with the user https://firebase.google.com/docs/ai-logic/get-started) - The Firebase CLI commands below run through `npx` on every platform, so they need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for them and to log in to the Firebase CLI. If Node.js is missing or older than version 20, ask the user to install it as that skill describes. Don't install system packages yourself, for example with `sudo apt-get`, because that changes the user's machine without their consent.

### 1. Provision Firebase AI Logic (ALL platforms)

Use the **Firebase CLI** to provision Firebase AI Logic for the Firebase Project:

1. Make sure that you're in a firebase directory (with a `firebase.json`).

1. Verify that you're running Firebase CLI commands against the intended Firebase Project. When you run this command, the active project is marked with "current":

```bash npx -y firebase-tools@latest projects:list ```

1. Make sure there's at least one Firebase App for the target platform registered with the current Firebase Project:

```bash npx -y firebase-tools@latest apps:list ```

1. Provision Firebase AI Logic for the Firebase Project:

```bash npx -y firebase-tools@latest init ailogic ```

This command will enable the Gemini Developer API in the Firebase project.

> [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all > platforms (Android, iOS, Web, or Flutter), even if the app already uses > Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to > provision the service. The configuration files of `GoogleService-Info.plist`, > `google-services.json`, and `firebase_options.dart` ONLY handle client > configuration and do NOT enable the Firebase AI Logic service, leading to > `PERMISSION_DENIED` errors.

If you can't run `init ailogic` yourself (for example because Node.js is missing or the Firebase CLI isn't logged in) do NOT skip it. The app's requests to Gemini models will fail until the Firebase AI Logic service is provisioned. Tell the user to run this command in their project directory, and include it in your final summary:

```bash npx -y firebase-tools@latest init ailogic ```

### 2. Add the SDK and initialize the service in the app

Adding the SDK dependency and initializing the service are platform-specific. Before writing code, read the reference for the target platform listed under [Initialization Code References](#initialization-code-references).

More info in [Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)

______________________________________________________________________

## Core Capabilities

> [!WARNING] **CRITICAL: Use current model names:** Always check the > [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt) > for the currently supported model names. Do NOT use any Gemini 1.x or Gemini > 2.x models (such as `gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash`, > `gemini-2.0-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, or > `gemini-2.5-pro`), as older models are deprecated or shut down. Always use a > currently supported Gemini 3+ model; if URL access is blocked in your > environment, proceed directly without searching local files.

### Text-Only Generation

### Multimodal (Text + Images/Audio/Video/PDF input)

Firebase AI Logic allows Gemini models to analyze image files directly from your app. This enables features like creating captions, answering questions about images, detecting objects, and categorizing images. Beyond images, Gemini can analyze other media types like audio, video, and PDFs by passing them as inline data with their MIME type. For files larger than 20 megabytes (which can cause HTTP 413 errors as inline data),

Install

Run this command

npx skills add firebase/agent-skills

Works with

claude appclaude codeclaude apicursorcodexwindsurfclinezed

Manual steps

Install with `npx skills add firebase/agent-skills`, or clone the repository and copy the `skills/firebase-ai-logic-basics` folder into your Claude skills directory.

View source

Frequently asked questions

What is the Firebase AI Logic Basics skill?

Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.

How do I install Firebase AI Logic Basics?

Run this in your terminal:

npx skills add firebase/agent-skills
Which AI tools does Firebase AI Logic Basics work with?

It works with claude_app, claude_code, claude_api, cursor, codex, windsurf, cline, zed.

Who made Firebase AI Logic Basics?

firebase.

Is Firebase AI Logic Basics free?

Yes, it is free to use.

Related assets

More curated picks in Development & Code.

All Firebase AI Logic Basics alternatives →
skillclaude_appclaude_codeclaude_api
git clone https://github.com/anthropics/skills && cp -r skills/skills/claude-api ~/.claude/skills/
Claude Api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration.…★ 4.8 · 2,500+
skillclaude_appclaude_codeclaude_api
npx skills add heygen-com/hyperframes
Hyperframes CLI
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - p…1,214,920+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Tdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.1,046,962+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Grilling
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrase…869,010+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Diagnosing Bugs
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing…746,030+
skillclaude_appclaude_codeclaude_api
npx skills add mattpocock/skills
Code Review
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented cod…696,572+

Audit before you install

Run any source through our checks - AI visibility, security, performance, and stack detection.

More in Development & Code