Nano Banana 2 已上线 AI Gateway

1 分钟阅读
2026 年 2 月 26 日
Gemini 3.1 Flash Image Preview(Nano Banana 2)现已在 AI Gateway 上可用。
这次发布在保持 flash-tier 模型生成速度和成本的同时,提升了视觉质量。
Nano Banana 2 可以使用 Google Image Search,让输出结果锚定在真实世界图像上。通过检索实时视觉数据,它在渲染较冷门地标和物体时表现更好。该模型还引入了可配置的思考等级(Minimal 和 High),使模型在渲染前能够先对复杂提示词进行推理。除现有选项外,现已新增分辨率和纵横比(512p、1:4 和 1:8),以支持更多类型的创意资产。
要使用该模型,请在 AI SDK 中将 model 设置为 google/gemini-3.1-flash-image-preview。Nano Banana 2 是一个多模态模型。可使用 streamText 或 generateText 在返回文本响应的同时生成图像。下面的示例展示了模型如何使用网页搜索获取实时数据。

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',});
你也可以调整思考等级:在这个示例中,thinking 被设置为 high,以获得更充分的响应。

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 提供统一 API,用于调用模型、跟踪使用量与成本,并可配置重试、故障切换和性能优化,以实现高于单一提供商的可用性。它还内置了 observability、Bring Your Own Key 支持,以及带自动重试的智能提供商路由。
进一步了解 AI Gateway,查看 AI Gateway model leaderboard,或在我们的 model playground 中试用。
原文链接:https://vercel.com/changelog/nano-banana-2-is-live-on-ai-gateway

