Nano Banana API & AI Studio Intro
Last updated:2026-08-21· 17 min read
🚀 Quick access
- Nano Banana 2 Domestic:Open entry↗
- Text-to-image studio:Open mirror↗
- Official Gemini:gemini.google.com ↗

Updated: 2026-08-21. Endpoints, model IDs, quotas, and prices follow the Gemini API image docs and Google AI console for that day; this guide does not hard-code unit prices or rate-limit numbers that age poorly.
Introduction
“Nano Banana API” and “Gemini API image” mean wiring image generation into a site, design pipeline, or internal tool. Production-ready integration is more than “one successful generate”—you also need: keys never in the frontend, configurable model IDs, retryable failures, observable usage, and reviewable outputs. Gemini web is for exploration; product integration uses a server-side API, with AI Studio for prompt and tier rehearsal.
What this guide solves
- Separate App experience, AI Studio, and production API paths
- Treat product names (Nano Banana 2 / 2 Lite / Pro) apart from doc model IDs
- Minimum baseline for keys, log redaction, and cost alerts
- A pre-launch checklist—not a single pretty sample
App ≠ AI Studio ≠ API
| Path | Good for | Weak for |
|---|---|---|
| Gemini App | Fast layout trials, edit chat | High-concurrency production, key custody |
| AI Studio | Prompt tuning, tier compares, export samples | Personal keys in public repos |
| Gemini API | Server automation, product features | Exposing keys in the browser |
If you start on a China-friendly third-party web entry, remember: third-party ≠ Google official—accounts and billing may be fully separate. Access paths: China access.
Model IDs: don’t mix product names and doc codes
Externally you can say Nano Banana 2, Nano Banana 2 Lite, Nano Banana Pro; in code, use the model codes listed in the docs (Flash Image / Flash Lite Image / Pro Image series as published). Lists update—tutorials must not treat one day’s string as eternal truth.
Selection shortcuts (details in dedicated guides):
- Balanced production default: Nano Banana 2
- High-throughput drafts: 2 Lite
- Family overview: What is Nano Banana
Config tip: keep model names in env vars or remote config so releases don’t require code edits.
Recommended landing sequence
- In AI Studio, run the target tier with the same prompt; save working parameters.
- Read official image docs: auth, how responses carry images, safety filter notes.
- Call from the server with the official SDK or HTTPS; inject the key via local env vars.
- Classify logs for success / safety block / timeout / quota (never log full keys).
- Add budget alerts and per-user rate limits so prompt abuse can’t empty the bill.
# Local dev example (names per your project)
export GEMINI_API_KEY="your-secret-here"
export NANOBANANA_MODEL="/* paste today's model id from docs */"
$env:GEMINI_API_KEY = "your-secret-here"
$env:NANOBANANA_MODEL = "/* paste today's model id from docs */"
Hard rule: keys only in server secret systems—never frontend bundles, Git, screenshots, or shared sheets. Rotate immediately on leak.
Cost and quality observability
Log per call: model ID, resolution tier, refs attached or not, latency, safety blocks, human adopt/reject.
Then you can answer “how much Lite drafting saved” and “2 final pass rate”—not vibe-based selection. Version prompts too: prompt guide.
Common automation pattern: Lite batch candidates → human or rule shortlist → 2/Pro polish → design tool for type and export. Hands-on: Getting started.
Completion checklist
- Current model ID from docs (configurable) confirmed
- API key server-only; repo has no secrets
- Timeouts, retries, error classes implemented
- Logs have no keys and no undesanitized user images
- Usage/budget alerts on (if console provides them)
- Human or automated review gate before end-user display
- Copyright and reference licenses recorded
Quick access
- Official App: gemini.google.com
- AI Studio: aistudio.google.com
- Dev docs: ai.google.dev image generation
- China-friendly third-party: Nano Banana 2
FAQ
If the web app lists a model, does the API always have it?
Not always in sync. Trust the API docs and console “available models” list—don’t assume an App button name equals a callable ID.
Can the browser call the Gemini API directly for images?
Not recommended. Browsers cannot safely hold long-lived keys and are easy to abuse. Proxy through your own backend.
Can a China third-party “API” stand in for official?
Don’t assume equivalence. Protocols, logs, routing, and compliance duties may differ. Prefer official docs for real product integration, and assess third-party terms separately.
Where are prices and RPM limits written?
Google AI / Gemini API pricing and quota pages for that day; this tutorial does not copy numbers that expire.
Official resources
Further reading
Summary
Engineering Nano Banana means separating exploration (App / Studio) from production (server API): configurable model IDs, keys out of the frontend, observable cost and blocks, reviewed outputs before launch. Confirm today’s models in official image docs, version prompts and style cards, and the pipeline stays both fast and controllable.
Related
Nano Banana Guides Hub
2026 Nano Banana hub: Gemini image learning path, entry vs model vs API, family map, a five-step first render, and links to every guide.
What Is Nano Banana? Model Family Explained
2026 what Nano Banana is: Gemini image family (2, 2 Lite, Pro, legacy), product names vs API IDs, capability limits, and a three-step selection method.
Nano Banana in China: Official + Third-Party Access
2026 Nano Banana China access: Gemini, AI Studio, and China-friendly third-party paths, with account/network notes, risk disclosure, and a completion checklist.
Nano Banana 2 Complete Guide
Nano Banana 2 (Gemini 3.1 Flash Image): vs Lite/Pro, generate-and-edit workflow, aspect/resolution, on-image text, and a delivery checklist.