Xenodia Docs
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 = url

Multipart 示例:

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

FieldNotes
model必须是 nano-banana-pro
prompt必填文本 prompt。
aspect_ratio以 model capability data 为准;常见值包括 1:116:9auto
resolution1K2K4K
output_format需要特定图片格式时使用,例如 pngjpg
image_input可选 URL reference。可以重复字段或使用数组。
image / image[]可选 multipart file references。
async设为 true 使用 task mode。

Responses and errors

Sync 返回 200data[].url。Async 返回 202task_idstatepoll_url。常见错误:400401402502

本页内容