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/generationsXenodia は 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 = urlParameters
| Field | Notes |
|---|---|
model | gpt-image-2 固定。 |
prompt | 必須 text prompt。 |
image_input | optional reference image input。reference があると reference-image mode になります。 |
image / image[] | optional multipart reference file fields。 |
aspect_ratio | 現在の値は auto、1:1、9:16、16:9、4:3、3:4。 |
resolution | optional。1K、2K、4K。aspect_ratio: auto では 1K のみ、aspect_ratio: 1:1 は 4K と併用不可。 |
output_format | Xenodia 上の GPT Image-2 では現在未対応。 |
async | true で 202 task envelope を受け取る。 |
Responses and errors
Sync は 200 と data[].url を返します。Async は 202 と task_id、state、poll_url を返します。Task Retrieval で polling してください。
よくある error status:400 invalid parameters、401 missing/invalid key、402 billing boundary、502 generation failure。