Image Generation API
Create image tasks with Xenodia's shared image endpoint, model-specific parameters, and reference input.
Use POST /v1/images/generations to create a public image generation task. Multiple models share the same endpoint, but supported parameters and pricing can differ by model. The endpoint returns a task immediately; poll the task endpoint for the final image URL.
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"
}Task request
{
"model": "nano-banana-pro",
"prompt": "A cinematic dashboard screenshot for a developer API product.",
"aspect_ratio": "16:9",
"resolution": "2K",
"response_format": "url"
}The request returns a task identifier. Poll it with Task Retrieval. The async field can still be sent for backward compatibility, but image generation always uses task mode.
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 "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
Image requests return a 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 は現在未対応。- Store the returned
task_idand pollpoll_urluntilsuccessorfail. - 一時 URL の場合、生成 asset は早めに download する。