Xenodia Docs
API リファレンス

GPT Image-2 API

Xenodia 上で `gpt-image-2` を使い、prompt-only と reference-image generation を行う。

gpt-image-2 は shared image endpoint を使います:

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

Xenodia は 1 つの public model ID を公開します。Prompt-only request と reference image 付き request は自動的に routing されます。

Prompt-only request

{
  "model": "gpt-image-2",
  "prompt": "A crisp technical illustration of an AI gateway routing model calls.",
  "aspect_ratio": "16:9",
  "resolution": "2K",
  "response_format": "url"
}

Reference-image request

{
  "model": "gpt-image-2",
  "prompt": "Use the reference as the product shape and render it in a clean studio.",
  "image_input": [
    "https://example.com/reference.png"
  ],
  "response_format": "url"
}

Multipart file reference:

curl -X POST "https://api.xenodia.xyz/v1/images/generations" \
  -H "Authorization: Bearer $XENODIA_API_KEY" \
  -F "model=gpt-image-2" \
  -F "prompt=Use the uploaded reference as the product shape." \
  -F "response_format=url" \
  -F "image=@./reference.png"

Current public rules

reference_input.max_items = 16
accepted_mime = image/jpeg, image/png, image/webp
max_size_per_file_bytes = 31457280
response_format = url

Parameters

FieldNotes
modelgpt-image-2 固定。
prompt必須 text prompt。
image_inputoptional reference image input。reference があると reference-image mode になります。
image / image[]optional multipart reference file fields。
aspect_ratio現在の値は auto1:19:1616:94:33:4
resolutionoptional。1K2K4Kaspect_ratio: auto では 1K のみ、aspect_ratio: 1:14K と併用不可。
output_formatXenodia 上の GPT Image-2 では現在未対応。
asynctrue202 task envelope を受け取る。

Responses and errors

Sync は 200data[].url を返します。Async は 202task_idstatepoll_url を返します。Task Retrieval で polling してください。

よくある error status:400 invalid parameters、401 missing/invalid key、402 billing boundary、502 generation failure。

このページ