🧪 Contoh Request / Response
image_url / task_id pada contoh adalah nilai placeholder SIM; lingkungan demo tidak benar-benar membuat gambar.
Teks-ke-Gambar (sinkron)
Request
POST /openapi/v1/images/generate
X-App-Key: ak_live_SIM8x2kQ
X-Timestamp: 1737000000
X-Sign: 9f2c…SIM…a1
{
"prompt": "batik mega mendung, vector style, navy blue",
"size": "2048x2048",
"style": "flat_vector",
"lang": "id-ID"
}Response
{
"code": 0,
"data": {
"image_url": "https://cdn.aifengdcs.com/sim/t2i_9f2c.png (SIM)",
"beans_charged": 10,
"simulated": true
}
}Matting (tugas asinkron)
Request
POST /openapi/v1/images/matting
X-App-Key: ak_live_SIM8x2kQ
X-Timestamp: 1737000040
X-Sign: 51bd…SIM…7e
{
"image_url": "https://cdn.aifengdcs.com/in/photo_1024.jpg",
"feather": 2,
"callback_url": "https://your-server.example/callback"
}Response
{
"code": 0,
"data": {
"task_id": "task_SIM_88ab12",
"status": "QUEUED",
"simulated": true
}
}Contoh Payload Callback
Request
POST https://your-server.example/callback
X-Sign: 77ac…SIM…09
{
"task_id": "task_SIM_88ab12",
"status": "DONE",
"result_url": "https://cdn.aifengdcs.com/sim/matting_88ab12.png (SIM)",
"simulated": true
}