异步提交(推荐)
请求体设置 responseMode 为 async。接口很快返回 HTTP 202 和 taskId,不等待图片生成;之后用 GET 查询任务,直到拿到图片 URL。
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
}
}'