generate-images-with-firebase-ai

generate-images-with-firebase-ai is a skill for Claude Code from evanca/flutter-ai-rules. It costs 84 tokens per session (2,125 once invoked), scanned A, original, MIT.

A guide for generating or editing images in Flutter and Dart apps through Firebase AI Logic and Gemini image models. It covers setup choices, request responses, user-photo input, quotas, billing, and App Check.

In plain words
What is it for?
Use it when connecting a Flutter app to Firebase image generation, choosing between the Gemini Developer API and Vertex AI, handling image responses, or investigating quota, billing, and App Check errors.
Why use it?
It helps diagnose configuration and service problems that can cause image requests to fail, return nothing, or return only text or images.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter-ai-skills plugin — 37 skills shipped together

Good fit Use it when connecting a Flutter app to Firebase image generation, choosing between the Gemini Developer API and Vertex AI, handling image responses, or investigating quota, billing, and App Check errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add evanca/flutter-ai-rules --skill generate-images-with-firebase-ai
Clone the repo
git clone --depth 1 https://github.com/evanca/flutter-ai-rules

Made for: Claude Code.

Or install flutter-ai-skills, the plugin that ships this one along with the rest of its 37 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for generate-images-with-firebase-ai

README.md
[![agentmods](https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai/github.svg)](https://agentmods.dev/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai)
Your own site
<a href="https://agentmods.dev/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai"><img src="https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for generate-images-with-firebase-ai

Your own site · 80×15
<a href="https://agentmods.dev/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai"><img src="https://agentmods.dev/badge/skills/evanca/flutter-ai-rules/generate-images-with-firebase-ai.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,125 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 179
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00084 $0.02125
Opus 5 $0.00042 $0.01063
Sonnet 5 $0.00017 $0.00425
Haiku 4.5 $0.00008 $0.00213

Measured 12d ago against content hash d09b320b125b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

generate-images-with-firebase-ai scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/generate-images-with-firebase-ai/SKILL.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generating images with Firebase AI Logic

Gemini image models return interleaved text and image parts from one call. The response is a sequence to walk, not a string to read.

A request that comes back empty is usually a configuration problem rather than a bug in your code, so section 1 covers the three settings that cause it.

1. Three things that block the very first call

A first call that returns an error, an empty response, or a 403 is almost always one of these rather than your Dart. Rule them out before you debug code.

Billing. Image generation has no free tier. On a Spark-plan project the image models return limit: 0 for generate_content_free_tier_requests, so the first request fails on quota having made zero requests. Text models do work on Spark, which means "my other Gemini call works" proves nothing. Upgrade to Blaze, then verify the current limits rather than trusting this note:

gcloud services quota list --service=generativelanguage.googleapis.com --consumer=projects/YOUR_PROJECT_ID

App Check. Firebase AI Logic enforces App Check when the project has it turned on. Otherwise the endpoint is open to anyone who extracts your config from the shipped client, and that config is public by design. Anything reachable from a device you do not control needs App Check. Debug builds attest with a debug provider, release builds with a real one. Web has a specific trap that costs an afternoon, described in references/setup.md.

responseModalities. Without it the model has no permission to return an image, so you get text describing the picture it would have drawn. Set both modalities, as in the call below.

2. The minimal call that works

final model = FirebaseAI.googleAI().generativeModel(
  model: 'gemini-3.1-flash-image',
  generationConfig: GenerationConfig(
    responseModalities: [
      ResponseModalities.text,
      ResponseModalities.image,
    ],
    imageConfig: ImageConfig(
      aspectRatio: ImageAspectRatio.landscape16x9,
      imageSize: ImageSize.size2K,
    ),
  ),
);

final response = await model.generateContent([
  Content.multi([
    TextPart(prompt),
    InlineDataPart('image/jpeg', selfieBytes), // omit for text-to-image
  ]),
]);

Read the full file on GitHub · 214 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 214 lines · 84 tokens per session scan A d09b320b125b

Subscribe to this mod's changes

generate-images-with-firebase-ai is a skill published in the GitHub repository evanca/flutter-ai-rules (637 stars, last pushed 12d ago), licensed MIT. It adds 84 tokens to every session and 2,125 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories