Nano Banana 2 high quality image generation.

使用参考图片
关闭即为文生图。开启后可上传或粘贴最多 14 张参考图片。
Output aspect ratio. Custom WxH pixel sizes remain accepted in JSON mode when supported upstream.
Output quality tier. 0.5K is text-to-image only.
Web search
Use web search to optimize image generation when supported upstream.
Image search
Search visual references to enhance generation quality when supported upstream.
Reasoning depth before generating images.
美元估算 $0.025-$0.05:最高充值套餐按 $1 = 2,000 积分计算;入门套餐按 $1 = 1,000 积分计算。

历史记录
保存在此浏览器本地
0 个运行中 · 0 个已完成
计费规则
API 说明
通过标准 REST API 调用该模型。使用 API Key 鉴权后,在下方选择端点即可查看其参数与示例。
鉴权
每个请求都需要在 Authorization 头中携带 Bearer 令牌。请在控制台创建 API Key。
Authorization: Bearer YOUR_API_KEYhttps://apiany.ai/v1/images/generations请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | 字符串 | 必填 | 要调用的模型标识,使用该模型的 ID。 |
prompt | 字符串 | 必填 | 描述你想生成内容的文本提示词。 |
size | 字符串 | 可选 | Output aspect ratio. Custom WxH pixel sizes remain accepted in JSON mode when supported upstream. · 可选值: auto, 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 · 默认: auto |
quality | 字符串 | 可选 | Output quality tier. 0.5K is text-to-image only. · 可选值: 0.5K, 1K, 2K, 4K · 默认: 2K |
model_params.web_search | 布尔值 | 可选 | Use web search to optimize image generation when supported upstream. · 默认: false |
model_params.image_search | 布尔值 | 可选 | Search visual references to enhance generation quality when supported upstream. · 默认: false |
model_params.thinking_level | 字符串 | 可选 | Reasoning depth before generating images. · 可选值: auto, min, high · 默认: auto |
callback_url | 字符串 | 可选 | 可选的回调地址,异步任务完成后会被调用。 |
请求示例
curl "https://apiany.ai/v1/images/generations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "nano-banana-2",
"prompt": "A cinematic 4k product scene for APIAny.AI with crisp model cards",
"size": "auto",
"quality": "2K",
"model_params": {
"web_search": false,
"image_search": false,
"thinking_level": "auto"
}
}'响应示例
{
"task_id": "task_abc123",
"status": "pending",
"poll_url": "/v1/tasks/task_abc123",
"request_id": "req_abc123",
"credits": {
"reserved": 1000
}
}该端点为异步调用:请求后会立即返回 task_id。请轮询任务状态查询端点,直到 status 变为 succeeded 后再读取 result。生成的媒体链接有效期为 24 小时。