STYLR AI API

Virtual try-on & AI styling, as an API.

The same engine that powers the Stylr app — realistic garment try-on, background-free garment extraction, auto-labeling, visual product matching and outfit recommendations — behind a single REST API.

POST /tryon
# 1. Start a try-on — returns a job (202 Accepted)
curl -X POST https://api.stylrapp.io/tryon \
  -H "Authorization: Bearer $STYLR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tryOnPhotoId": "5f9b…",
    "garmentId": "b31c…",
    "garmentSource": "extracted"
  }'

CAPABILITIES

One API for the whole styling stack.

Virtual Try-On

Transfer any garment onto a person photo with realistic fit, drape and lighting. Upper, lower and full-body garments supported.

Multi-Garment Outfits

Compose a full look — up to 8 garments — onto one photo in a single pass, from an explicit list or a saved outfit.

Garment Extraction

Turn a worn or messy photo into a clean, background-free flat-lay of just the garment, ready for catalog or try-on.

AI Auto-Labeling

Return structured attributes — category, subtype, colors, material, pattern — from a single garment image, vocabulary-aware.

Shop the Look

Detect the garments in an image and return shoppable product matches with links, powered by visual recognition + product search.

Outfit Recommendations

Get outfit picks from a wardrobe, ranked by weather, occasion and wear history — the daily-look engine behind the app.

QUICK START

From request to render in two calls.

Try-on runs asynchronously: kick off a job, then poll it until the render is ready.

1 · request
# 1. Start a try-on — returns a job (202 Accepted)
curl -X POST https://api.stylrapp.io/tryon \
  -H "Authorization: Bearer $STYLR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tryOnPhotoId": "5f9b…",
    "garmentId": "b31c…",
    "garmentSource": "extracted"
  }'
202 · response
{
  "id": "8ad2c0…",
  "type": "tryon",
  "status": "pending",
  "outputs": []
}
2 · poll the job
# 2. Poll the job until status is "done"
curl https://api.stylrapp.io/jobs/8ad2c0… \
  -H "Authorization: Bearer $STYLR_API_KEY"

{
  "id": "8ad2c0…",
  "status": "done",
  "outputs": [
    { "url": "https://cdn.stylrapp.io/…/output-0.jpg",
      "small": "https://cdn.stylrapp.io/…/out-0-small.jpg",
      "medium": "https://cdn.stylrapp.io/…/out-0-medium.jpg" }
  ]
}

API REFERENCE

Endpoints

Base URL https://api.stylrapp.io · every request takes a Bearer token.

POST/tryon

Start a single-garment try-on. Returns a job you poll for the result.

tryOnPhotoIduuidreq
The person photo to dress.
garmentIduuidreq
The garment to try on.
garmentSource"uploaded" | "extracted"opt
Which garment image to use. Defaults to the clean extracted flat-lay when available.

Returns · 202 Accepted — a job object (status: pending).

POST/tryon/outfit

Try a full outfit (multiple garments) on one photo in a single pass.

tryOnPhotoIduuidreq
The person photo to dress.
garmentIdsuuid[]opt
1–8 garments to combine.
outfitIduuidopt
A saved outfit to try on instead.

Returns · 202 Accepted — a job object. Provide garmentIds or outfitId.

GET/jobs/{id}

Poll a try-on job until status is done, then read outputs[].

iduuidreq
The job id returned by a try-on call.

Returns · 200 — job with status and outputs: [{ url, small, medium }].

POST/garments/{id}/extract

Extract a clean, background-free flat-lay from a garment photo.

iduuidreq
The garment to extract.
promptstringopt
Optional hint to steer the extraction.

Returns · 200 — { ok: true }. Poll the garment for extractedUrl.

POST/garments/{id}/label

AI-label a garment into structured, vocabulary-aware attributes.

iduuidreq
The garment to label.

Returns · 200 — the garment with a structured labels object.

POST/shop-the-look

Detect garments in an image and return shoppable product matches.

garmentIduuidreq
The garment image to analyze.

Returns · 200 — { imageUrl, garmentCount, results: [{ garment, query, products }] }.

POST/recommend

Recommend outfits from a wardrobe by weather, occasion and history.

latnumberopt
Latitude for weather-aware picks.
longnumberopt
Longitude for weather-aware picks.
dayOffsetnumberopt
0 = today, 1 = tomorrow, …

Returns · 200 — recommended outfits with the garments and reasoning.

HOW IT BEHAVES

Response & limits

Auth

Bearer token on every request

Try-on / extraction

Async — 202 + poll GET /jobs/{id}

Input images

JPEG, PNG or WebP via HTTPS URL

Outfit try-on

Up to 8 garments per request

Output

Rehosted on Stylr CDN with small/medium variants

Footwear

Excluded from body try-on (422)

PRICING

Pay with credits, not surprises.

Every AI call spends from a credit pool. Start free, refresh monthly, or go usage-based at scale.

Free

$0

20 credits to start

  • All endpoints
  • Async try-on & extraction
  • Community support
Popular

Plus

$2.99/mo

120 credits / month

  • Everything in Free
  • Monthly credit refresh
  • Priority processing

Scale

Custom

Volume credits

  • High-throughput quota
  • Dedicated support
  • Usage-based billing

What a call costs

  • Virtual try-on (single or outfit)2 credits
  • Garment extraction2 credits
  • Shop the Look (recognition)1 credit
  • AI auto-labeling1 credit
  • Outfit recommendationsFree

API FAQ

How does the try-on API work?+

Try-on and extraction are asynchronous. You POST a request and get back a job with status: pending (HTTP 202). Poll GET /jobs/{id} until status is done, then read the outputs array — each output includes the full image plus small and medium variants rehosted on our CDN.

What images can I send?+

Send public HTTPS URLs to JPEG, PNG or WebP images — a person photo (the try-on target) and a garment image (the source). Extraction turns a worn or busy photo into a clean flat-lay you can reuse for try-on.

Can I try on a whole outfit at once?+

Yes. POST /tryon/outfit accepts up to 8 garments — an explicit garmentIds list or a saved outfitId — and renders them onto the photo in a single pass.

How is it billed?+

Every AI call spends credits: 2 for a try-on or extraction, 1 for recognition or labeling. Recommendations are free. Plans refresh your credit pool monthly; volume plans are usage-based.

Build try-on into your product.

Request an API key and start rendering looks today — or grab the Stylr app to see the engine in action.