图像与视频
gemini-nano-banana-2.1
模型ID:gemini-nano-banana-2.1
| 上下文窗口 | — |
|---|---|
| 计费方式 | 按次(元 / 次) |
| 单价(元 / 次) | 1K ¥0.25 / 2K ¥0.35 / 4K ¥0.5 |
| 倍率 | 1.00x |
各通道价格
| 通道 | 单价(元 / 次) | 倍率 |
|---|---|---|
| bananarouter-banana | ¥0.25 | 1.00x |
| bananarouter-banana | ¥0.35 | 1.00x |
| bananarouter-banana | ¥0.5 | 1.00x |
调用示例
本模型属于「图像与视频」分组,调用协议:网关媒体生成接口(图片按次、视频按秒计费)。填入你的 API Key 即可调用;分组决定入口,不能跨组混用(例如 Gemini 分组的模型不能走 /v1/messages)。
请求示例curl
curl https://www.relay-api.com/v1/images/generations \
-H "Authorization: Bearer sk-你的Key" \
-H "content-type: application/json" \
-d '{
"model": "gemini-nano-banana-2.1",
"prompt": "一只在草地上奔跑的柯基,清晨逆光",
"n": 1,
"size": "1024x1024"
}'
# 图生图 / 改图:参考图走 base64(data URL 或裸 base64 都收,最多 4 张)
# curl https://www.relay-api.com/v1/images/generations \
# -H "Authorization: Bearer sk-你的Key" \
# -H "content-type: application/json" \
# -d '{"model":"gemini-nano-banana-2.1","prompt":"把背景换成雪景","image":["data:image/png;base64,<BASE64>"]}'响应:网关把上游原始 JSON 透传回来(sk- 密钥不加包装;浏览器会话加 {code,data} 包装)——图片为 images 响应(url / b64_json),视频为 generateContent 响应。
