Skip to main content

Milo-AI Virtual Try-On Stylist

POST 

/open/aigw/gateway/generations

Upload clothing images and model images. AI generates try-on images where each model wears the target clothing.

Request flow

  1. Submit a generation task and get taskNo
  2. After completion, the system POSTs results to callbackUrl
  3. You can also poll GET /open/aigw/gateway/generationTask?taskNo=xxx

Request

Responses

Task submitted successfully

Callback payload

When generation finishes, the system POSTs this payload to callbackUrl.

On success:

{
"taskNo": "a1b2c3d4...",
"status": "success",
"model": "clothing-wear",
"timestamp": 1234567890,
"data": {
"task_id": "6928de47-2e53-4ee6-901b-be05a8bf7669",
"status": "SUCCESS",
"request_id": "123",
"result": [
{
"result_img_urls": [
"https://cdn.example.com/result_1.png",
"https://cdn.example.com/result_2.png"
]
}
],
"error_info": ""
},
"usage": { "totalPoints": 10 },
"sign": "sha256hex..."
}

On failure:

{
"taskNo": "a1b2c3d4...",
"status": "failed",
"model": "clothing-wear",
"timestamp": 1234567890,
"error": "Error message",
"sign": "sha256hex..."
}

Signature: sign = SHA256(taskNo + timestamp + apiKey)

Query task status

GET /open/aigw/gateway/generationTask?taskNo={taskNo}

Prefer callback delivery first. Polling is a fallback.

Request parameters:

ParameterTypeRequiredDescription
taskNostringYesTask ID returned when submitting

Success response example:

{
"code": 1000,
"message": "success",
"data": {
"taskNo": "a1b2c3d4...",
"model": "clothing-wear",
"status": "success",
"createTime": "2025-01-01 12:00:00",
"data": {
"result": [
{
"result_img_urls": ["https://cdn.example.com/result_1.png"]
}
]
},
"usage": { "totalPoints": 10 }
}
}

Failure response example:

{
"code": 1000,
"message": "success",
"data": {
"taskNo": "a1b2c3d4...",
"model": "clothing-wear",
"status": "failed",
"error": "Generation failed reason"
}
}

status values: pending, processing, success, failed