图像产品动态Nano Banana 2.1 图像 API

Nano Banana 2.1 API:官方示例、价格和请求方式

查找 Nano Banana 2.1 的模型 ID、每张 4 quota 的价格、请求参数和 Google 展示图。

TTAPI约 3 分钟阅读
粉色汽车旅馆外墙前,穿绿色裙子的女性站在黄色楼梯上Nano Banana 2.1 · Gemini Image
本文导读

你将了解

  • 确认模型 ID 和价格
  • 查看 Google 示例和改写提示词
  • 发送一次 TTAPI 生图请求
要点

在 TTAPI 同步 Gemini 图像接口中,以 gemini-nano-banana-2.1 调用此模型,每张 4 quota。先用简单提示词和文档支持的尺寸验证,再检查成图。

Nano Banana 2.1 已接入 TTAPI

2026 年 10 月 9 日,TTAPI 在 Nano Banana 的现有接口接入 gemini-nano-banana-2.1,按每张 4 quota 计费。仍使用 POST /gemini/image/generate、TT-API-KEY 和 JSON。

Google 称新版在画质、提示词遵循、角色一致性和文字呈现方面有所改进。TTAPI 页面提供接入信息。

用官方案例看不同任务的效果

Google DeepMind 展示涵盖汽车旅馆楼梯、雨中甲虫微距、高山驿站、地球剖面、立体文字和粉彩时装照。

TTAPI 图库将每个案例与按 Google 说明改写的提示词配对。自己的输出还会受具体用词、参考图、宽高比和尺寸影响。

粉色汽车旅馆外墙前,穿绿色裙子的女性站在黄色楼梯上
Google DeepMind 展示 · 复古汽车旅馆楼梯(提示词经改写)
原始提示词

Create a horizontal cinematic still of a two-story retro motel. A mustard-yellow exterior staircase cuts diagonally across a flamingo-pink facade while a woman in an emerald-green dress walks down it. Shoot from street level in warm sunlight, keeping the color blocking vivid and the architecture realistic.

在实际使用尺寸检查图中文字

地球剖面适合检查标注和视觉层级。Google 文档指出图表和文字效果有改进,但小字号、长文案在低分辨率下仍可能出错。

发布前逐项核对标签和数值,用最终尺寸生成,并检查完整清晰度的导出图。

带有地壳、地幔和地核标注的等轴测地球剖面
Google DeepMind 展示 · 带标注的地球剖面(提示词经改写)
原始提示词

Design a clean educational isometric cutaway of Earth. Clearly label the Crust, Mantle, Outer Core, and Inner Core, with distinct textures and a subtle glow in the center. Use deep earth colors, molten orange and yellow, and cool blue at the surface on a minimal light background.

发送一次请求并核对结果

示例用 gemini-nano-banana-2.1 直接生成 16:9、2K 图像。需要参考图时可通过 refer_images 传入 URL,先查最新数量限制。

每张 4 quota,约 $0.04。密钥应在服务器端,处理超时并记录输出网址和 quota。

用 Nano Banana 2.1 生成图像
cURL
curl --request POST \
  --url 'https://api.ttapi.org/gemini/image/generate' \
  --header "TT-API-KEY: $TTAPI_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gemini-nano-banana-2.1",
  "prompt": "Create a horizontal cinematic still of a two-story retro motel. A mustard-yellow exterior staircase cuts diagonally across a flamingo-pink facade while a woman in an emerald-green dress walks down it. Shoot from street level in warm sunlight, keeping the color blocking vivid and the architecture realistic.",
  "aspect_ratio": "16:9",
  "image_size": "2K"
}'
  • 在服务端设置 TTAPI_KEY 并通过 TT-API-KEY 发送
  • 确认模型 ID
  • 发布前检查图像与文字
  • 批量估价时核对当前价格
继续接入

查看 Nano Banana 2.1

从模型详情进入 API 文档,核对当前的接入方式。