Nano Banana 2 is live on AI Gateway
Source: Vercel Blog
Overview
Gemini 3.1 Flash Image Preview (Nano Banana 2) is now available on AI Gateway. This release improves visual quality while preserving the generation speed and cost of flash‑tier models.
Nano Banana 2 can use Google Image Search to ground outputs in real‑world imagery, helping render lesser‑known landmarks and objects by retrieving live visual data. The model also introduces configurable thinking levels (Minimal and High) so it can reason through complex prompts before rendering. New resolutions and aspect ratios (512 p, 1:4, and 1:8) are added alongside existing options, expanding support for a wider variety of creative assets.
New Features
- Google Image Search grounding – pulls live visual data for more accurate image generation.
- Configurable thinking levels –
minimalfor fast responses,highfor deeper reasoning. - Additional resolutions & aspect ratios – 512 p, 1:4, 1:8.
- Multimodal output – generate text and images in a single call.
Usage
Basic example
import { streamText } from 'ai';
const result = streamText({
model: 'google/gemini-3.1-flash-image-preview',
providerOptions: {
google: { responseModalities: ['TEXT', 'IMAGE'] },
},
prompt: 'Generate an image of the 2026 Super Bowl at golden hour',
});

Configuring the thinking level
import { streamText } from 'ai';
const result = streamText({
model: 'google/gemini-3.1-flash-image-preview',
providerOptions: {
google: {
responseModalities: ['TEXT', 'IMAGE'],
thinkingConfig: {
includeThoughts: true,
thinkingLevel: 'high',
},
},
},
prompt: `An exploded view diagram of a modern GPU, showing the die, HBM stacks, interposer,
and cooling solution as separate floating layers with labeled callouts.`,
});

AI Gateway
AI Gateway provides a unified API for calling models, tracking usage and cost, and configuring retries, failover, and performance optimizations for higher‑than‑provider uptime. It includes built‑in observability, Bring Your Own Key support, and intelligent provider routing with automatic retries.
Learn more about AI Gateway, view the AI Gateway model leaderboard, or try it in our model playground.