Nano Banana 2.1 API

google/gemini-nano-banana-2.1
Nano Banana 2.1 is an update to Nano Banana 2 (Gemini 3.1 Flash Image) for fast image generation and conversational editing, with improved visual quality, text rendering, multi-turn consistency and Google Search grounding at 1K, 2K and 4K.
Output
$0.104 / gen
Released
Oct 6, 2026

How to use Nano Banana 2.1 API

Install any OpenAI-compatible SDK, point it at api.aimlapi.com/v1, and set the model to google/gemini-nano-banana-2.1.
import requests

r = requests.post(
    "https://api.aimlapi.com/v1/images/generations",
    headers={"Authorization": "Bearer " + AIMLAPI_KEY},
    json={
      "model": "google/gemini-nano-banana-2.1",
      "prompt": "A weathered brass compass resting on a nautical chart",
      "resolution": "2K"
    },
)
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-nano-banana-2.1",
    "prompt": "A weathered brass compass resting on a nautical chart",
    "resolution": "2K"
  }),
});
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-nano-banana-2.1","prompt":"A weathered brass compass resting on a nautical chart","resolution":"2K"}'

OpenAI-compatible — swap the base URL and it works with your existing SDK.

Nano Banana 2.1 API Pricing

TypePrice
Input
$1.95 / 1M tokens
Output
$0.104 / gen

Billed per generation. 2K output is charged at 1.5x the standard rate, 4K at 2x, and 0.5K at 0.75x.

Nano Banana 2.1 vs other models

ModelInputOutputContextBest for
$1.95 / 1M tokens
$0.104 / gen
Image generation
$6.5 / 1M tokens
$39 / 1M tokens
Precise image editing
$6.5 / 1M tokens
$39 / 1M tokens
Image generation at scale
$6.5 / 1M tokens
$41.6 / 1M tokens
Image generation at scale

Frequently asked questions

Nano Banana 2.1 is Google's image model. It generates images from text prompts, and Google describes it as a high-efficiency image generation and editing model with improved visual quality, typography and multi-turn consistency.

0.5K (512px), 2K and 4K, set through the resolution parameter. Aspect ratio is adjustable.

$0.104 per generation at the standard rate. 2K output is charged at 1.5x that rate, 4K at 2x, and 0.5K at 0.75x.

Yes, web search grounding is an optional parameter, as is high thinking. Both are off by default.

Nano Banana 2.1 generates an image from a text prompt alone. Nano Banana 2.1 Edit takes reference images and transforms them from text instructions. They are separate endpoints at the same price.

Start building with Nano Banana 2.1

Get API Key
1000+ models, one API.