Async submission (recommended)
Set responseMode to async in the request body. The API quickly returns HTTP 202 and a taskId without waiting for the image; then poll the task with GET until the image URL is ready.
curl -X POST 'https://prompthub.xin/api/openapi/v1/images/generations' \
-H 'Authorization: Bearer phk_你的API密钥' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "一只猫坐在窗边,清晨自然光",
"model": "platform-image-model-id",
"clientRequestId": "image_demo_001",
"responseMode": "async",
"parameters": {
"aspectRatio": "16:9",
"quality": "2k",
"count": 1
}
}'