生成费用
$0.010 / 张图
图像模型
基础图片生成模型,适用于营销横幅、商品卡片和社交媒体内容。
API 状态:已通过 Grsai 代理上线
生成费用
$0.010 / 张图
请求限制
100 QPS
计费类型
按生成次数计费
更新时间
2026-03-10
Endpoint: /api/v1/images/nanobanana/generate
Method: POST
Authorization: `Authorization: Bearer $APISTOR_API_KEY`
响应模式: 默认 stream,也可通过 `webHook` 回调。
结果轮询: /api/v1/images/nanobanana/result (使用 `id` 发起 POST)。
错误类型: /errors
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 仅支持:nanobanano-2、nanobanano-2-2k、nanobanano-2-4k。 |
| prompt | string | 是 | 生成提示词。 |
| urls | string[] | 否 | 参考图 URL 或 base64 字符串。 |
| aspectRatio | string | 否 | 宽高比:auto、1:1、16:9、9:16、4:3、3:4、3:2、2:3、5:4、4:5、21:9。 |
| webHook | string | 否 | 回调 URL,或传 '-1' 立即返回任务 id 并改为轮询。 |
| shutProgress | boolean | 否 | 关闭中间进度,仅返回最终结果。 |
请求示例 (cURL)
curl -X POST "https://api.apistor.io/api/v1/images/nanobanana/generate" \
-H "Authorization: Bearer $APISTOR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nanobanano-2",
"prompt": "High-quality ecommerce hero image of a futuristic banana product, soft studio light",
"aspectRatio": "auto",
"shutProgress": false
}'响应示例 (JSON)
{
"id": "f44bcf50-f2d0-4c26-a467-26f2014a771b",
"model": "nano-banana-2",
"progress": 100,
"status": "succeeded",
"results": [
{
"url": "https://example.com/generated-image.jpg",
"content": "High-quality ecommerce hero image of a futuristic banana product, soft studio light"
}
],
"failure_reason": null
}如需轮询:发送 webHook='-1',并使用 /api/v1/images/nanobanana/result + id 查询结果。
打开错误目录