Nano Banana 2.1 from Google is now available on AI Gateway as google/gemini-nano-banana-2.1.
Compared with earlier Nano Banana models, it improves image generation and editing, including product recontextualization, mask- and ink-based editing, and factuality. In practice, that means placing products in new scenes, limiting edits to masked or marked regions, and depicting real-world subjects more accurately.
It also renders photorealistic skin tones, detailed materials, sharp lighting, and coherent backgrounds while maintaining Flash-tier latency and cost.
Set AI_GATEWAY_API_KEY, then use the model through the AI SDK, the OpenAI-compatible Chat Completions API, or AI CLI:
import { generateText } from 'ai';
const result = await generateText({ model: 'google/gemini-nano-banana-2.1', prompt: 'A studio photo of a ceramic coffee mug on a white background.',});Try Nano Banana 2.1 in imagen.sh or the model playground. See the image generation documentation for additional configuration and editing examples.
Browse all image models available on AI Gateway.
Reference Architecture
Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.
- Agent stack: Build and operate agents with models, tools, and durable workflows.
- Web applications: Choose rendering, data, authentication, and caching approaches.
- Backends: Choose a runtime, connect services, and run background work.
Build with prompts
Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.