Xenodia Docs
API リファレンス

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/generations

Minimal request

{
  "model": "gpt-image-2.5-flare",
  "prompt": "A clean product render of a translucent crystal compute object on a white desk.",
  "response_format": "url"
}

Task request

{
  "model": "gpt-image-2.5-sunburst",
  "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.5-flare",
  "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=gpt-image-2.5-sunburst" \
  -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、background、output_format、n、繰り返し可能な 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": "gpt-image-2.5-sunburst",
  "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_id and poll poll_url until success or fail.
  • 一時 URL の場合、生成 asset は早めに download する。

GPT Image 2.5

gpt-image-2.5-flare と gpt-image-2.5-sunburst はテキストからの画像生成と、最大16枚の参照画像による編集に対応します。prompt は1〜20,000文字です。

resolution は 1K(既定)、2K、4K、background は auto(既定)、opaque、transparent です。aspect_ratio は auto(既定)、1:1、3:2、2:3、16:9、9:16、4:3、3:4、21:9、27:16、16:27、9:8、8:9 に対応し、最後の4種類は 1K のみです。output_format は指定しないでください。

画像1枚の価格は1Kが0.01875 USDC、2Kが0.0625 USDC、4Kが0.10 USDCです。最新の価格とパラメータは /v1/models で確認できます。JSON と multipart の両方で background を指定でき、参照画像がある場合は編集になります。返されたタスクを完了までポーリングしてください。

このページ