API リファレンス
Image Generation API
Xenodia の shared image endpoint、model-specific parameters、reference input、async task mode で画像を生成する。
public image generation には POST /v1/images/generations を使います。複数の model が同じ endpoint を共有しますが、対応 parameter と pricing は model ごとに異なります。
Endpoint
POST https://api.xenodia.xyz/v1/images/generationsMinimal request
{
"model": "gpt-image-2",
"prompt": "A clean product render of a translucent AI gateway cube on a white desk.",
"response_format": "url"
}Async request
{
"model": "nano-banana-pro",
"prompt": "A cinematic dashboard screenshot for a developer API product.",
"async": true,
"aspect_ratio": "16:9",
"resolution": "2K",
"response_format": "url"
}Async request は task identifier を返します。Task Retrieval で polling します。
Reference inputs
reference 対応 model は image_input URL または multipart file を受け取れます。
{
"model": "gpt-image-2",
"prompt": "Use this reference as the product shape, render it in a clean studio.",
"image_input": [
"https://example.com/reference.png"
],
"response_format": "url"
}Multipart request:
curl -X POST "https://api.xenodia.xyz/v1/images/generations" \
-H "Authorization: Bearer $XENODIA_API_KEY" \
-F "model=nano-banana-pro" \
-F "prompt=Render the uploaded reference as a clean product image." \
-F "async=true" \
-F "response_format=url" \
-F "image=@./reference.png"Multipart fields は model、prompt、async、response_format、aspect_ratio、resolution、output_format、n、channel_id、繰り返し可能な image_input / image_input[] URL fields、image / image[] file fields です。
Responses
同期 request は 200 を返します:
{
"created": 1760000000,
"data": [
{
"url": "https://cdn.example.com/generated.png"
}
]
}非同期 request は 202 task envelope を返します:
{
"task_id": "task_123",
"object": "task",
"model": "nano-banana-pro",
"type": "image",
"state": "waiting",
"created_at": 1760000000,
"poll_url": "/v1/tasks/task_123"
}Shared rules
/v1/modelsで現在の model-specific limits を確認する。- discovery が明示しない限り
nは1のままにする。 response_format: "url"を使う。base64 image response は現在未対応。- 長時間の media generation は
async: trueを使う。 - 一時 URL の場合、生成 asset は早めに download する。