curl --request POST \
--url https://apiany.ai/v1/images/generations/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6",
"prompt": "A polished studio photograph of an orange ceramic robot",
"output_format": "png",
"size": "1:1",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}Images
画像生成を作成して結果を待機
画像タスクを作成し、最大待機時間まで待ちます。GPT Image 2.6 の完了時は data[0].url に PNG またはアニメーション GIF の URL を 1 個返します。HTTP 202 の場合は返されたタスクを引き続きポーリングします。
POST
/
v1
/
images
/
generations
/
sync
curl --request POST \
--url https://apiany.ai/v1/images/generations/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "gpt-image-2.6",
"prompt": "A polished studio photograph of an orange ceramic robot",
"output_format": "png",
"size": "1:1",
"n": 1
}
'{
"created": 123,
"data": [
{
"url": "<string>",
"b64_json": "<string>",
"revised_prompt": "<string>"
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"input_tokens": 123,
"output_tokens": 123,
"cached_input_tokens": 123
}
}{
"task_id": "task_123",
"status": "pending",
"poll_url": "/v1/tasks/task_123",
"model": "<string>"
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"param": "<string>",
"code": "<string>"
}
}承認
ボディ
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5