curl --request POST \
--url https://openapi.imini.ai/imini/router/v1/images/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/nano-banana-2",
"prompt": "A cute shiba inu in a spacesuit standing on the moon, 3D cartoon style",
"aspect_ratio": "1:1",
"resolution": "512"
}
'
{
"task_id": "task_2041350318103396352",
"model": "google/nano-banana",
"created_at": "2026-04-07T03:00:17.062Z",
"request_id": "285f20ce-8158-401b-945c-7bc6a7ef6ead"
}{
"error": {
"code": "INVALID_PROMPT",
"message": "Prompt contains disallowed content",
"status": 400,
"request_id": "req_abc123"
}
}图像模型 API
Nano Banana 2
谷歌 Gemini 3.1 Flash Image,Flash 系列功能最全,支持 14 种比例与 512p~4K 分辨率
POST
/
v1
/
images
/
generate
curl --request POST \
--url https://openapi.imini.ai/imini/router/v1/images/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "google/nano-banana-2",
"prompt": "A cute shiba inu in a spacesuit standing on the moon, 3D cartoon style",
"aspect_ratio": "1:1",
"resolution": "512"
}
'
{
"task_id": "task_2041350318103396352",
"model": "google/nano-banana",
"created_at": "2026-04-07T03:00:17.062Z",
"request_id": "285f20ce-8158-401b-945c-7bc6a7ef6ead"
}{
"error": {
"code": "INVALID_PROMPT",
"message": "Prompt contains disallowed content",
"status": 400,
"request_id": "req_abc123"
}
}授权
在请求 Header 中传入 Authorization: Bearer <YOUR_API_KEY>。前往 API Keys 管理页 创建和管理 API Key。
请求体
application/json
固定值 google/nano-banana-2
提示词,不超过 6000 字符。支持中英文,推荐使用细节丰富的描述以获得更好的生成效果。
示例:
"A cute shiba inu in a spacesuit standing on the moon, 3D cartoon style"
参考图列表。不传或传空数组则为文生图模式;传入图像则进入图生图/风格参考模式。最多 14 张。
Maximum array length:
14Show child attributes
Show child attributes
输出宽高比,支持 14 种:
1:1 2:3 3:2 3:4 4:3 4:5 5:4 9:16 16:9 21:9 1:4 1:8 4:1 8:1
传入参考图时若不指定该参数,模型会自动识别参考图比例并以此作为输出比例。
可用选项:
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:4, 1:8, 4:1, 8:1 输出质量档位:512 / 1K / 2K / 4K
512为本系列专属低分辨率档位,适合快速预览或原型验证,成本最低、速度最快。
可用选项:
512, 1K, 2K, 4K 
