Image Generation API
Generate images with Xenodia's shared image endpoint, model-specific parameters, reference inputs, and async task mode.
Use POST /v1/images/generations for public image generation. Models share the same endpoint, but supported parameters and pricing can differ by 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"
}An async request returns a task identifier. Poll it through Task Retrieval.
Reference inputs
Models that support references can accept image_input URL values or multipart files, depending on model capability metadata.
{
"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 requests use the same endpoint with multipart/form-data:
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"Accepted multipart fields are model, prompt, async, response_format, aspect_ratio, resolution, output_format, n, channel_id, repeated image_input / image_input[] URL fields, and repeated image / image[] file fields.
Responses
Synchronous requests return 200 with image data:
{
"created": 1760000000,
"data": [
{
"url": "https://cdn.example.com/generated.png"
}
]
}Async requests return 202 with a 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
- Use
/v1/modelsto confirm the current model-specific limits. - Keep
nat1unless discovery explicitly says otherwise. - Use
response_format: "url"; base64 image responses are not currently supported. - Use
async: truefor long-running media generation. - Download generated assets promptly if returned URLs are temporary.