Xenodia Docs
API 参考

Nano Banana Pro API

Use Nano Banana Pro through Xenodia with resolution tiers, aspect ratio, output format, reference input, and 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"
}

Task request

{
  "model": "nano-banana-pro",
  "prompt": "Create a polished product hero image for Xenodia docs.",
  "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 "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。
asyncDeprecated compatibility field. Image generation always returns a 202 task envelope.

Responses and errors

The request returns 202 with task_id, state, and poll_url. Poll the task for the final result.data[].url. Common errors are 400, 401, 402, and 502.

本页内容