Product photos
POST
https://us-central1-aiavatar-01.cloudfunctions.net/businessApi/productsSend photos of a product. You get back clean photos of it on a plain white background, each from a different angle.
What to send
Send the request as multipart/form-data (the normal way to upload files) 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. Letters, numbers and . _ - @ : only. |
photo | Required | A photo of the product (JPG or PNG, up to 8 MB). To send more than one, add the photo field again — up to 6. More angles of the real product give better results. |
count | Required | How many photos you want back, from 1 to 5. Each one shows the product from a different angle. |
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/products" \
-H "X-Api-Key: cp_live_xxxxxxxxxxxxxxxx" \
-F user_id=u_1042 \
-F count=4 \
-F size=1 \
-F [email protected] \
-F [email protected]
Example response
You get this straight away. The photos are not ready yet — see Check results.
{
"job_id": "8f21c0e2-…", // save this — you'll use it to get the photos
"status": "queued", // your request is waiting to start
"type": "product",
"user_id": "u_1042", // the user you sent
"model_id": null, // not used for products
"count": 4, // photos you asked for
"size": 1,
"balance": { "images_left": 246 } // photos left on your plan after this request
}
Good to know
- 4 photos are held from your balance now. If we can't make one, it goes back to your balance.
- Send only products here. Clothing goes to
/clothing. - If this user already has a request running, you get
USER_BUSY. See Errors & retries.
