图片模型Nano Banana
Nano Banana 2.1
Nano Banana 2.1 的 API 模型、参数和调用说明。
模型 ID
nano-banana-2.1
参数
| 字段 | 类型 | 说明 |
|---|---|---|
prompt | string | 必填的图片描述 |
input_mode | string | text_to_image 或 image_edit |
reference_images | string[] | 编辑时的参考图片 URL |
resolution | string | 1K、2K 或 4K,默认 1K |
n | integer | 默认 1,仅支持 1 |
aspect_ratio | string | 默认 1:1;支持 auto、1:1、5:4、9:16、21:9、16:9、3:2、4:3、4:5、3:4、2:3 |
reference_images | string[] | 编辑时传入,最多 14 张 |
调用方式
请先调用 GET /v1/models,读取该模型实时返回的 schema.fields、能力和价格。参数、默认值、枚举和区域可用状态以接口返回为准。
- 图片或视频模型使用
POST /v1/generations。 - 文字模型使用
POST /v1/chat/completions或POST /v1/responses。 - 生成前可使用
POST /v1/quote预估消耗。
示例
{
"model": "nano-banana-2.1",
"prompt": "Describe the desired result clearly",
"resolution": "1K",
"aspect_ratio": "1:1",
"n": 1
}该页面记录模型入口;具体参数必须以当前区域的模型 schema 为准,不要将其他模型的字段直接复制过来。

