API 参考
Nano Banana Pro API
在 Xenodia 使用 Nano Banana Pro 的 resolution tiers、aspect ratio、output format、reference input 和 async task mode。
nano-banana-pro 使用 shared image endpoint:
POST https://api.xenodia.xyz/v1/images/generations当你需要显式控制 aspect ratio、resolution、output format 和 reference images 时使用这页。
Request
{
"model": "nano-banana-pro",
"prompt": "A clean studio render of a developer API dashboard on a glass desk.",
"aspect_ratio": "16:9",
"resolution": "2K",
"output_format": "png",
"response_format": "url"
}Async request
{
"model": "nano-banana-pro",
"prompt": "Create a polished product hero image for Xenodia docs.",
"async": true,
"aspect_ratio": "16:9",
"resolution": "4K",
"response_format": "url"
}返回 task 后通过 Task Retrieval 轮询。
Reference inputs
Nano Banana Pro 支持 prompt-only generation、URL references、multipart file references 和 mixed reference input。
reference_input.max_items = 8
accepted_mime = image/jpeg, image/png, image/webp
max_size_per_file_bytes = 31457280
transport = url, multipart_file
response_format = urlMultipart 示例:
curl -X POST "https://api.xenodia.xyz/v1/images/generations" \
-H "Authorization: Bearer $XENODIA_API_KEY" \
-F "model=nano-banana-pro" \
-F "prompt=Create a polished product hero image using this reference." \
-F "async=true" \
-F "aspect_ratio=16:9" \
-F "resolution=4K" \
-F "response_format=url" \
-F "image=@./reference.png"Parameters
| Field | Notes |
|---|---|
model | 必须是 nano-banana-pro。 |
prompt | 必填文本 prompt。 |
aspect_ratio | 以 model capability data 为准;常见值包括 1:1、16:9、auto。 |
resolution | 1K、2K 或 4K。 |
output_format | 需要特定图片格式时使用,例如 png 或 jpg。 |
image_input | 可选 URL reference。可以重复字段或使用数组。 |
image / image[] | 可选 multipart file references。 |
async | 设为 true 使用 task mode。 |
Responses and errors
Sync 返回 200 和 data[].url。Async 返回 202 和 task_id、state、poll_url。常见错误:400、401、402、502。