Xenodia Docs
API Reference

Image Generation API

Create image generation tasks with Xenodia's shared image endpoint, model-specific parameters, and reference inputs.

Use POST /v1/images/generations for public image generation tasks. 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 final image URLs.

Endpoint

POST https://api.xenodia.xyz/v1/images/generations

Minimal 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 through Task Retrieval. The async field is accepted for compatibility, but image generation always uses task mode.

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 "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

Image 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/models to confirm the current model-specific limits.
  • Keep n at 1 unless discovery explicitly says otherwise.
  • Use response_format: "url"; base64 image responses are not currently supported.
  • Store the returned task_id and poll poll_url until success or fail.
  • Download generated assets promptly if returned URLs are temporary.

On this page