What is Nano Banana 2 API?
Nano Banana 2 is a compact text-to-image model from Google optimized for fast image generation.
Technical Specifications
- Supported inputs: Image, Text
- Output: Image
- Endpoint: /images/generations
Performance Benchmarks
[embed]
Nano Banana 2 API Pricing
- Input: $0.325 / 1M tokens
- Output: $1.95 / 1M tokens
- Output images: $78 / 1M tokens
Where to Use Nano Banana 2
High-volume image generation
Produce product visuals, thumbnails, and marketing assets programmatically at scale.
Creative and concept art
Turn text prompts into illustrations, mockups, and design explorations.
Image editing and variations
Provide a reference image to guide edits, restyles, or variations.
Code Sample
[embed]
Measured on the AI/ML API gateway across live traffic. Figures are medians unless stated. Last updated 2026-10-12.
Nano Banana 2 is documented as suited for text-to-image generation, including creating images from prompts with strong image understanding and generation capabilities.
It is also suited for image-guided editing and iterative image refinement, including multi-turn workflows where a user can keep adjusting the result across turns.
The model is documented for creating clear text-heavy visuals such as posters, marketing mockups, and diagrams.
It is also suited to producing more accurate grounded imagery, including infographics and historically or factually informed scenes.
import requests r = requests.post( "https://api.aimlapi.com/v1/images/generations", headers={"Authorization": "Bearer " + AIMLAPI_KEY}, json={ "model": "google/gemini-3.1-flash-image-preview", "prompt": "A cat holding a sign that says hello" }, ) print(r.json())
const r = await fetch("https://api.aimlapi.com/v1/images/generations", { method: "POST", headers: { Authorization: `Bearer ${process.env.AIMLAPI_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "model": "google/gemini-3.1-flash-image-preview", "prompt": "A cat holding a sign that says hello" }), }); console.log(await r.json());
curl -X POST https://api.aimlapi.com/v1/images/generations \ -H "Authorization: Bearer $AIMLAPI_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"google/gemini-3.1-flash-image-preview","prompt":"A cat holding a sign that says hello"}'
OpenAI-compatible — swap the base URL and it works with your existing SDK.
| Type | Price |
|---|---|
| Input | |
| Output | |
Text input $0.325/1M · reasoning $1.95/1M · image output $78/1M. Free credits on signup.
| Benchmark | Score | What it measures | Source | Retrieved |
|---|---|---|---|---|
| Text-to-Image Arena | 1123 | Human preference Elo from blind pairwise comparisons of generated images, measured independently by Artificial Analysis | Source | September 28, 2026 |
| Model | Input | Output | Context | Best for |
|---|---|---|---|---|
Nano Banana 2 This page | Image generation at scale | |||
| Image generation at scale | ||||
| Image generation at scale | ||||
| Image generation at scale |
Nano Banana 2 takes image, text as input and returns image.
Nano Banana 2 became available on February 27, 2026.
Nano Banana 2 is priced at input $0.325 / 1M tokens, output $78 / 1M tokens.
Nano Banana 2 is billed per token, charged separately for input and output.
Yes, Nano Banana 2 supports image editing as well as generation.
Yes, Nano Banana 2 accepts image input as well as a text prompt.
Nano Banana 2 was built by Google.
Send a request to https://api.aimlapi.com/v1/images/generations with google/gemini-3.1-flash-image-preview as the model id.
Yes. Nano Banana 2 is served through AI/ML API, so the same key and endpoint format used for other models applies.