Virtual try-on API
Add virtual try-on to your app or site with one HTTP request. JSON responses; results via polling or webhook.
Authentication
Send the key in the Authorization header. Test keys start with hk_test_ and live keys with hk_live_.
Authorization: Bearer hk_live_xxxxxxxxxxxxxxxx
Create a try-on
POST https://houshstyle.ir/api/v1/try-on/ — multipart/form-data, or JSON with image URLs
| Parameter | Description |
person_image / person_image_url | Person photo (one required) |
garment_image / garment_image_url / garment_id | Garment photo or product ID (one required) |
garment_type | Garment or accessory type key (table at the bottom); default w_gown |
on_model | true if the garment photo is worn by a model or mannequin (the model's face and body are not transferred) |
gender | w or m; for unisex items such as backpacks and caps |
garment_image_2, garment_type_2, on_model_2 … | Second and third items (optional), e.g. outfit + shoes + bag |
resolution | standard (1 credit) | hd (2 credits) |
lock_face, remove_garment_background | true / false |
webhook_url, client_ref | optional |
curl -X POST https://houshstyle.ir/api/v1/try-on/ \
-H "Authorization: Bearer $HUSH_KEY" \
-F person_image=@person.jpg \
-F garment_image=@dress.jpg \
-F garment_type=w_gown \
-F garment_image_2=@heels.jpg \
-F garment_type_2=w_heels \
-F resolution=hd \
-F webhook_url=https://your-app.com/hooks/tryon
Response (202):
{"id": "8b1c…", "status": "queued", "result_url": null, "credits_charged": 2, ...}
Get the result
GET https://houshstyle.ir/api/v1/try-on/{id}/
Statuses: queued, processing, completed, failed. When completed, result_url is the final image. If a try-on fails, the credit is refunded automatically (refunded=true).
Python example
import requests, time
H = {"Authorization": "Bearer hk_live_..."}
r = requests.post("https://houshstyle.ir/api/v1/try-on/", headers=H,
files={"person_image": open("me.jpg", "rb"), "garment_image": open("dress.jpg", "rb")},
data={"garment_type": "w_cocktail"})
job = r.json()
while job["status"] in ("queued", "processing"):
time.sleep(2)
job = requests.get(f"https://houshstyle.ir/api/v1/try-on/{job['id']}/", headers=H).json()
print(job["result_url"])
JavaScript (Node) example
const fd = new FormData();
fd.append("person_image_url", "https://cdn.example.com/u/123.jpg");
fd.append("garment_id", "42");
const res = await fetch("https://houshstyle.ir/api/v1/try-on/", {
method: "POST", headers: { Authorization: `Bearer ${process.env.HUSH_KEY}` }, body: fd });
console.log(await res.json());
PHP example
$ch = curl_init("https://houshstyle.ir/api/v1/try-on/");
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("HUSH_KEY")],
CURLOPT_POSTFIELDS => ["person_image" => new CURLFile("me.jpg"), "garment_image" => new CURLFile("coat.jpg"),
"garment_type" => "m_blazer"]]);
echo curl_exec($ch);
Webhook
When processing finishes, a POST with a JSON body and the following headers is sent to webhook_url:
X-Hush-Timestamp: 1760780000
X-Hush-Signature: sha256=HMAC_SHA256(webhook_secret, timestamp + "." + raw_body)
{"event": "tryon.completed", "data": {"id": "...", "status": "completed", "result_url": "..."}}
# Python verify
import hmac, hashlib
expected = hmac.new(SECRET.encode(), ts.encode() + b"." + body, hashlib.sha256).hexdigest()
assert hmac.compare_digest("sha256=" + expected, signature)
Other endpoints
GET /api/v1/usage/ — Remaining credit and this month's usage
GET /api/v1/garments/ — Garments available to try on (public + your products)
GET /api/v1/try-on/list/ — Latest 50 try-ons
Error codes
| 400 invalid_image | Invalid, too small or too large image |
| 401 | Invalid or disabled key |
| 402 org_credits | Organisation credit exhausted |
| 429 | Rate limit exceeded (default 60 requests per minute) |
| 503 unavailable | Service temporarily unavailable; retry in a few seconds |
Garment and accessory types (garment_type)
u_ keys are unisex. Old English names (such as cocktail dress) are still accepted.
Clothing — Women
| Key | Type | Group |
w_gown | Long evening gown / maxi | Evening & bridal |
w_midi_formal | Midi evening dress | Evening & bridal |
w_cocktail | Short / cocktail dress | Evening & bridal |
w_lace | Lace / guipure / sheer evening dress | Evening & bridal |
w_sequin | Sequined / beaded evening gown | Evening & bridal |
w_strapless | Strapless evening dress | Evening & bridal |
w_offshoulder | Off-the-shoulder evening dress | Evening & bridal |
w_ballgown | Ball gown / princess dress | Evening & bridal |
w_mermaid | Mermaid evening gown | Evening & bridal |
w_bridal | Wedding dress | Evening & bridal |
w_dress | Everyday women's dress | Everyday dresses |
w_knitdress | Knit dress | Everyday dresses |
w_manto | Manteau (long coat) | Jackets, manteaux & coats |
w_kimono | Open-front manteau / kimono / long cardigan | Jackets, manteaux & coats |
w_coat | Women's coat / trench | Jackets, manteaux & coats |
w_blazer | Women's blazer (keep your own top) | Jackets, manteaux & coats |
w_blazer_inner | Women's blazer with the top/blouse in the photo | Jackets, manteaux & coats |
w_jacket | Women's jacket (denim, leather…) | Jackets, manteaux & coats |
w_puffer | Women's puffer jacket | Jackets, manteaux & coats |
w_cardigan | Women's cardigan | Jackets, manteaux & coats |
w_vest | Women's vest / gilet | Jackets, manteaux & coats |
w_chador | Chador | Chador & abaya |
w_chador_sleeved | Sleeved chador (national / Lebanese) | Chador & abaya |
w_abaya | Abaya | Chador & abaya |
w_top | Women's T-shirt / top | Tops |
w_blouse | Women's blouse / shirt | Tops |
w_tunic | Tunic | Tops |
w_knit | Women's sweater | Tops |
w_hoodie | Women's hoodie / sweatshirt | Tops |
w_jeans | Women's jeans | Bottoms |
w_trousers | Women's trousers / chinos | Bottoms |
w_wideleg | Wide-leg / palazzo trousers | Bottoms |
w_joggers | Women's joggers | Bottoms |
w_skirt | Skirt | Bottoms |
w_shorts | Women's shorts | Bottoms |
w_leggings | Leggings | Socks, tights & leggings |
w_tights_sheer | Sheer tights / pantyhose | Socks, tights & leggings |
w_tights_opaque | Opaque / colored tights | Socks, tights & leggings |
w_tights_pattern | Patterned / fishnet tights | Socks, tights & leggings |
w_kneesocks | Knee-high socks | Socks, tights & leggings |
w_socks | Women's ankle socks | Socks, tights & leggings |
w_kaftan | Kaftan / jalabiya | Traditional |
w_local | Women's traditional costume | Traditional |
Clothing — Men
| Key | Type | Group |
m_blazer | Men's blazer (keep your own shirt) | Jackets, manteaux & coats |
m_blazer_shirt | Men's blazer with the shirt in the photo | Jackets, manteaux & coats |
m_jacket | Men's jacket (leather, denim…) | Jackets, manteaux & coats |
m_puffer | Men's puffer jacket | Jackets, manteaux & coats |
m_overcoat | Men's overcoat / trench | Jackets, manteaux & coats |
m_cardigan | Men's cardigan | Jackets, manteaux & coats |
m_vest | Men's vest / gilet | Jackets, manteaux & coats |
m_shirt | Men's dress shirt | Tops |
m_shirt_casual | Men's casual / checked shirt | Tops |
m_tshirt | Men's T-shirt | Tops |
m_polo | Polo shirt | Tops |
m_knit | Men's sweater | Tops |
m_hoodie | Men's hoodie / sweatshirt | Tops |
m_jeans | Men's jeans | Bottoms |
m_trousers | Men's trousers / chinos | Bottoms |
m_cargo | Cargo trousers | Bottoms |
m_joggers | Men's joggers | Bottoms |
m_shorts | Men's shorts | Bottoms |
m_socks | Men's socks | Socks, tights & leggings |
m_compression | Men's compression tights | Socks, tights & leggings |
m_thobe | Thobe / dishdasha | Traditional |
m_bisht | Bisht / men's cloak | Traditional |
m_kurdish | Men's Kurdish suit | Traditional |
Sets & one-pieces — Women
| Key | Type | Group |
w_suit | Women's trouser suit (keep your own top) | Suits & formal sets |
w_suit_full | Women's trouser suit with the top in the photo | Suits & formal sets |
w_skirtsuit | Women's skirt suit | Suits & formal sets |
w_manto_set | Manteau & trousers set | Casual, sport & loungewear sets |
w_manto_set_scarf | Manteau, trousers & shawl set | Casual, sport & loungewear sets |
w_twopiece | Two-piece set (top + skirt/trousers) | Casual, sport & loungewear sets |
w_tracksuit | Women's tracksuit | Casual, sport & loungewear sets |
w_activewear | Activewear set (leggings + top) | Casual, sport & loungewear sets |
w_pajama | Women's pajama / lounge set | Casual, sport & loungewear sets |
w_jumpsuit | Women's jumpsuit | Jumpsuits & overalls |
w_playsuit | Women's playsuit | Jumpsuits & overalls |
w_overalls | Women's dungarees / overalls | Jumpsuits & overalls |
w_look | Complete women's look from one photo (clothes + shoes + bag) | Complete look from one photo |
w_bridal_set | Wedding gown with veil | Complete look from one photo |
Sets & one-pieces — Men
| Key | Type | Group |
m_suit | Men's suit (keep your own shirt) | Suits & formal sets |
m_suit_shirt | Men's suit with the shirt and tie in the photo | Suits & formal sets |
m_threepiece | Three-piece suit (with waistcoat) | Suits & formal sets |
m_tux | Tuxedo | Suits & formal sets |
m_tracksuit | Men's tracksuit | Casual, sport & loungewear sets |
m_pajama | Men's pajama / lounge set | Casual, sport & loungewear sets |
m_shirt_pants | Men's shirt & trousers set | Casual, sport & loungewear sets |
m_tee_shorts | Men's T-shirt & shorts set | Casual, sport & loungewear sets |
m_jumpsuit | Men's jumpsuit | Jumpsuits & overalls |
m_coverall | Work coverall | Jumpsuits & overalls |
m_overalls | Men's dungarees / overalls | Jumpsuits & overalls |
m_look | Complete men's look from one photo (clothes + shoes + bag) | Complete look from one photo |
Sets & one-pieces — Unisex
| Key | Type | Group |
u_onesie_hood | Hooded onesie (top + trousers + hood) | Jumpsuits & overalls |
Accessories — Women
| Key | Type | Group |
w_heels | High heels / evening shoes | Shoes |
w_flats | Women's flats / ballerinas / loafers | Shoes |
w_sneakers | Women's sneakers | Shoes |
w_sandals | Women's sandals / slides | Shoes |
w_ankleboots | Women's ankle boots | Shoes |
w_boots | Women's tall boots | Shoes |
w_handbag | Handbag | Bags |
w_shoulderbag | Shoulder / crossbody bag | Bags |
w_clutch | Evening clutch | Bags |
w_necklace | Necklace / gold necklace | Jewelry |
w_earrings | Earrings | Jewelry |
w_bracelet | Bracelet / bangle | Jewelry |
w_ring | Ring | Jewelry |
w_jewelset | Jewelry set | Jewelry |
w_anklet | Anklet | Jewelry |
w_brooch | Brooch | Jewelry |
w_watch | Women's wristwatch | Watches |
w_sunglasses | Women's sunglasses | Eyewear |
w_hat | Women's brimmed / straw / fedora hat | Hats & caps |
w_headscarf | Headscarf | Headscarves, shawls & maghnaeh |
w_shawl | Shawl | Headscarves, shawls & maghnaeh |
w_maghnaeh | Maghnaeh (hood scarf) | Headscarves, shawls & maghnaeh |
w_turban | Turban / hijab cap | Headscarves, shawls & maghnaeh |
w_silkscarf | Silk neckerchief | Scarves, ties & bow ties |
w_belt | Women's belt | Belts & gloves |
w_tiara | Tiara / crown | Tiaras & hair accessories |
w_hairclip | Headband / hair clip | Tiaras & hair accessories |
w_veil | Bridal veil | Tiaras & hair accessories |
Accessories — Men
| Key | Type | Group |
m_dressshoes | Men's dress shoes | Shoes |
m_loafers | Men's loafers | Shoes |
m_sneakers | Men's sneakers | Shoes |
m_boots | Men's boots | Shoes |
m_sandals | Men's sandals / slides | Shoes |
m_bag | Men's briefcase / shoulder bag | Bags |
m_chain | Men's chain necklace | Jewelry |
m_bracelet | Men's bracelet | Jewelry |
m_ring | Men's ring | Jewelry |
m_cufflinks | Cufflinks | Jewelry |
m_watch | Men's wristwatch | Watches |
m_sunglasses | Men's sunglasses | Eyewear |
m_hat | Men's fedora hat | Hats & caps |
m_tie | Necktie | Scarves, ties & bow ties |
m_bowtie | Bow tie | Scarves, ties & bow ties |
m_pocketsquare | Pocket square | Scarves, ties & bow ties |
m_belt | Men's belt | Belts & gloves |
Accessories — Unisex
| Key | Type | Group |
u_backpack | Backpack | Bags |
u_beltbag | Belt bag / small crossbody | Bags |
u_smartwatch | Smartwatch | Watches |
u_eyeglasses | Eyeglasses / frames | Eyewear |
u_cap | Baseball cap | Hats & caps |
u_beanie | Knit beanie | Hats & caps |
u_bucket | Bucket hat | Hats & caps |
u_neckscarf | Scarf (neck) | Scarves, ties & bow ties |
u_gloves | Gloves | Belts & gloves |