Clothing photos
POST
https://us-central1-aiavatar-01.cloudfunctions.net/businessApi/clothingSend photos of a garment and choose one of your models. You get back photos of the model wearing it, each in a different pose.
What to send
Send the request as multipart/form-data with your key in the X-Api-Key header.
| Field | Required? | What to send |
|---|---|---|
user_id | Required | The id of your user who is making this request — the same id you use in your own app. It lets you see later how many photos each user made. |
model_id | Required | Which of your models should wear the garment. Get the ids from GET /models. |
gender | Required | male or female — the same as the model you chose. |
cloth | Required | A photo of the garment (JPG or PNG, up to 8 MB). To send more, add the cloth field again — up to 4, for example front, back and a close-up. |
count | Required | How many photos you want back, from 1 to 5. Each one shows a different pose. |
size | Optional | 1 for square 1024×1024 (this is the default). 2 for portrait 768×1024. |
Example request
curl -X POST "https://us-central1-aiavatar-01.cloudfunctions.net/businessApi/clothing" \
-H "X-Api-Key: cp_live_xxxxxxxxxxxxxxxx" \
-F user_id=u_1042 \
-F model_id=5b0e3f1c-… \
-F gender=female \
-F count=3 \
-F size=2 \
-F [email protected] \
-F [email protected]
Example response
You get this straight away. The photos are not ready yet — see Check results.
{
"job_id": "3c9a71d4-…", // save this — you'll use it to get the photos
"status": "queued", // your request is waiting to start
"type": "clothing",
"user_id": "u_1042",
"model_id": "5b0e3f1c-…", // the model wearing the garment
"count": 3,
"size": 2,
"balance": { "images_left": 243 } // photos left on your plan after this request
}
Good to know
- We work out what kind of garment it is (top, bottom, dress…) and frame the photo to suit it.
- Send only clothing here. Other products go to
/products. - Clear, flat, well-lit garment photos give the best results.
