---
title: "nano-banana + Gemini key"
description: "Free image generation via Google's Gemini Nano Banana model."
source: "Obsidian Academy"
source_url: https://obsidian-academy.pages.dev/setup/04-nano-banana-setup/
saved: 2026-05-16
tags: [obsidian-academy, saved-from-web, setup]
---

The `nano-banana` skill generates images by calling the Gemini CLI's `nanobanana` extension, which hits Google's `gemini-2.5-flash-image` (or `gemini-3-pro-image-preview`) endpoints. With the free Gemini API tier, you get ~500 images/day — plenty for personal use.

## What's installed

| Component | Where | Notes |
|---|---|---|
| `@google/gemini-cli` | Global npm install | `npm install -g @google/gemini-cli` |
| nanobanana extension | `~/.gemini/extensions/nanobanana/` | Installed via `gemini extensions install` |
| nano-banana skill | `~/.claude/skills/nano-banana/SKILL.md` | The Claude Code wrapper |
| GEMINI_API_KEY | User env var (`setx`) + `~/.nano-banana/.env` | Persisted across reboots |
| Extension enablement | `~/.gemini/extensions/extension-enablement.json` | Must NOT have `"overrides": ["/C:/Users/justi/*"]` |

## Verify it works

```bash
gemini --yolo -p "/generate 'a single yellow banana on white background'"
```

If everything's good, an image appears in `./nanobanana-output/`. If you see "GEMINI_API_KEY not set", the env var didn't propagate — open a new terminal.

## Get a Gemini API key

If you ever rotate yours:

1. Visit [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
2. Sign in with any Google account (no payment method required)
3. Click "Create API key"
4. Copy the key (starts with `AIza...`)
5. Update it in two places:
   - User env var: `setx GEMINI_API_KEY "your-key"`
   - `~/.nano-banana/.env`: edit the file

> [!NOTE]
> **The API key is sensitive.** Don't commit it to git, don't paste in public chats, don't embed in screenshots. Treat like a password.

## The extension enablement gotcha

A known quirk during setup: `gemini extensions list` returns empty even when extensions are installed. Cause: the extension has an "overrides" entry in `~/.gemini/extensions/extension-enablement.json` that disables it for your home directory.

Fix: edit the file so the extension's `overrides` array is empty (`[]`) or remove the entry entirely.

```json
{
  "nanobanana": {
    "overrides": []
  }
}
```

That re-enables it globally.

## Free-tier limits

As of May 2026:

- **gemini-2.5-flash-image**: ~500 images/day, free
- **gemini-3-pro-image-preview**: ~150 images/day, free (higher quality)
- Resolution: up to 4K
- Aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:2, 21:9 etc.

Hard rate limits (per minute) exist but you'll hit the daily cap first if you're bulk-generating.

## Cost if you exceed free tier

Per Google's pricing as of mid-2026:

- ~$0.04 per 1K image (flash)
- ~$0.14 per 4K image (pro)

Trivial unless you batch-generate at scale.

## Models the skill knows about

The skill accepts model aliases:

| Alias | Real model | Use for |
|---|---|---|
| `flash` (default) | `gemini-2.5-flash-image` | Daily use, speed, volume |
| `pro` | `gemini-3-pro-image-preview` | High-quality featured images, 4K |

Override per call: `gemini --yolo -p "/generate '...' --model pro"`

## Where outputs go

Default: `./nanobanana-output/` in whatever directory you ran the command from.

In the [Content Engine](/workflows/05-content-engine/) workflow, outputs get moved to `80-Content/assets/[slug]/`. In the [Visual Journal](/workflows/08-visual-journal/) workflow, into `10-Daily/` next to the day's note.

## When the skill triggers

The skill is set up to be invoked for ANY image request the user makes. The frontmatter:

```yaml
description: REQUIRED for all image generation requests. Generate and edit images using Nano Banana (Gemini CLI). Handles blog featured images, YouTube thumbnails, icons, diagrams, patterns, illustrations, photos, visual assets, graphics, artwork, pictures. Use this skill whenever the user asks to create, generate, make, draw, design, or edit any image or visual content.
```

If you ever want Claude to use a different image tool, edit this frontmatter.
