Capability · Kleding
Virtual try-on API voor kleding
In één zin
Photta's virtual try-on API accepteert een flat-lay kledingafbeelding en een mannequin-ID en retourneert een 2K- of 4K-foto op een model. POST de taak, poll elke 3–5 seconden, download wanneer de status completed is.
- Typische duur: 1–1.5 min
- Credits: 5 credits bij 2K · 6 credits bij 4K
- Verwerking: async, polling
- Limieten: 600 requests/min
- Authenticatie: Bearer key
Elk getal op deze pagina is afkomstig uit de Photta-API-documentatie · gecontroleerd
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/tryon/apparel \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/tryon/apparel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/tryon/apparel",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
},
)
data = res.json()["data"] # data["id"], data["status"]
In één oogopslag
In één oogopslag
- Endpoint
- POST /api/v1/tryon/apparel
- Authenticatie
- Bearer API key
- Verwerking
- Asynchroon — poll het status-endpoint
- Typische duur
- 1–1.5 min
- Credits
- 5 credits bij 2K · 6 credits bij 4K
- Beeldverhoudingen
- 3:4 · 1:1 · 4:3 · 2:3 · 3:2 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9
- Invoerlimieten
- Tot 10 MB per afbeelding; JPEG, PNG, WebP
- Idempotent
- Ja
Request en response
Request
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/tryon/apparel \
-H "Authorization: Bearer $PHOTTA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')const res = await fetch("https://api.photta.app/api/v1/tryon/apparel", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/tryon/apparel",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"product_type": "top",
"product_images": [
"https://cdn.yourstore.com/products/shirt-front.jpg"
],
"product_back_image": "https://cdn.yourstore.com/products/shirt-back.jpg",
"product_category": "tshirt",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"resolution": "2K",
"aspect_ratio": "3:4",
"body_size": "M",
"expression": "neutral",
"user_instruction": "Keep the collar pattern crisp and centered."
},
)
data = res.json()["data"] # data["id"], data["status"]202 Accepted / Completed
{
"data": {
"id": "try_abc123",
"status": "processing",
"product_type": "top",
"mannequin_id": "mnk_f3a9b1",
"background_color": "#F5F0E8",
"lock_background": false,
"resolution": "2K",
"aspect_ratio": "3:4",
"credits_used": 5,
"created_at": "2026-04-10T12:00:00Z"
},
"request_id": "req_xyz789"
}{
"data": {
"id": "try_abc123",
"status": "completed",
"product_type": "top",
"mannequin_id": "mnk_f3a9b1",
"resolution": "2K",
"aspect_ratio": "3:4",
"output_url": "https://cdn.photta.app/generated/try_abc123.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/try_abc123-thumb.jpg",
"credits_used": 5,
"created_at": "2026-04-10T12:00:00Z",
"completed_at": "2026-04-10T12:01:15Z",
"duration_ms": 75000
},
"request_id": "req_abc001"
}Request-parameters
product_typeType: stringVereist
Type of garment.
Waarden:topbottomtop_and_bottomone_pieceproduct_imagesType: array[string]Vereist
Array of image URLs or base64 data URIs. The first entry is the FRONT image and is required. Not used when product_type is "top_and_bottom".
product_back_imageType: string
Optional URL or base64 data URI for the BACK of the garment. Sending one IS the request for a back shot: the model is photographed from behind and this image is the reference. Omit it and you get the front. There is deliberately no separate "view" field — two fields that can contradict each other. Not used when product_type is "top_and_bottom".
top_imageType: string
Front image of the top garment. Required when product_type is "top_and_bottom".
top_back_imageType: string
Optional back image of the top garment. Sending one asks for a back shot, exactly as product_back_image does.
bottom_imageType: string
Front image of the bottom garment. Required when product_type is "top_and_bottom".
bottom_back_imageType: string
Optional back image of the bottom garment. Sending one asks for a back shot, exactly as product_back_image does.
mannequin_idType: stringVereist
ID of the mannequin to wear the garment, from GET /api/v1/mannequins: one of Photta's, or one of your workspace's own while it is active. Another account's model, or one that was removed, is a 404; a jewellery or eyewear model is a 400.
background_colorType: string
The backdrop, as a colour. One of white, light_gray, gray, charcoal, black, beige, cream, sand — or any hex value (#F5F0E8, F5F0E8, #fff). It travels to the engine as TEXT; nothing is uploaded, and the same value reproduces exactly on every run. Omit it for the engine's clean studio default. An unrecognised value returns 400 rather than quietly falling back. Echoed back on the response.
Waarden:whitelight_graygraycharcoalblackbeigecreamsandpose_idType: string
RETIRED 2026-08-10 — accepted and ignored. Poses were removed from apparel try-on; every generation is now a straight, relaxed, camera-facing shot (full length; a `top` is framed three-quarter). Sending it returns Deprecation and Sunset headers. Deleted 2027-02-10 — stop sending it.
backgroundType: string
RETIRED 2026-08-11 — accepted and ignored, never downloaded. Backdrop photographs were removed: recreating a room competed with the garment for the engine's attention. Use background_color instead. Sending it returns Deprecation and Sunset headers. Deleted 2027-02-10.
lock_backgroundType: boolean
RETIRED 2026-08-11 — accepted and ignored, and always false on responses. It never worked as previously documented: the prompt engine has always discarded the flag, so the "faithful reproduction" this page used to promise was never delivered. background_color is the first backdrop control that actually holds still. Deleted 2027-02-10.
= false
resolutionType: string
Output resolution.
= 2K
Waarden:2K4Kaspect_ratioType: string
Output aspect ratio.
= 3:4
Waarden:3:41:14:32:33:24:55:49:1616:921:9body_sizeType: string
Build of the model. The letter sizes map onto builds: XS → petite, S → slim, M → regular, L → curvy, XL and XXL → plus size. The build names (`petite`, `slim`, `regular`, `athletic`, `curvy`, `plus_size`) are accepted too. An unknown value adds no build to the prompt. A child model is always drawn with a child's build, whatever is sent.
= M
Waarden:XSSMLXLXXLpetiteslimregularathleticcurvyplus_sizeexpressionType: string
Facial expression. `happy` and `smiling` are both a soft smile. An unknown value adds no expression to the prompt.
= neutral
Waarden:neutralsoft_smileconfidentseriousrelaxedhappysmilingfootwear_urlType: string
URL or base64 of a custom footwear image. It is worn when the feet are in frame (full-length shots; a `top` is framed three-quarter).
user_instructionType: string
Free-form refinement, e.g. "preserve the seam pattern across the shoulder", "keep the collar contrast strong". Capped at 500 characters server-side; longer strings are silently truncated. Useful for brand-specific details that need an extra nudge.
product_categoryType: string
The kind of garment, as a category key (e.g. "tshirt", "jeans", "blazer", "mididress"; lower-case, no separators). It names the garment in the prompt's length sentence; an unknown key reads as "garment". Used for product_type "top", "bottom", and "one_piece". REQUIRED when `mannequin_id` is a child model: without it the request is a 400 (`param: "product_category"`), and swimwear or underwear on a child model is a 400 `content_policy_violation`, both before anything is charged.
top_categoryType: string
Silhouette anchor for the top half. Only valid when product_type is "top_and_bottom".
bottom_categoryType: string
Silhouette anchor for the bottom half. Only valid when product_type is "top_and_bottom".
lengthType: string
Garment length key for product_type "top", "bottom", or "one_piece". List available values with GET /api/v1/garment-attributes?type=length&garment_type={product_type}.
fitType: string
Garment fit key for product_type "top", "bottom", or "one_piece". List available values with GET /api/v1/garment-attributes?type=fit&garment_type={product_type}.
top_lengthType: string
Top length key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=length&garment_type=top.
top_fitType: string
Top fit key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=fit&garment_type=top.
bottom_lengthType: string
Bottom length key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=length&garment_type=bottom.
bottom_fitType: string
Bottom fit key. Only valid when product_type is "top_and_bottom". List with GET /api/v1/garment-attributes?type=fit&garment_type=bottom.
Errors
- 400
invalid_request_error - The request is malformed or contains invalid parameters.
- 401
authentication_error - The API key is missing, invalid, or expired.
- 402
insufficient_credits_error - Your account does not have enough credits, or (background removal) a free account has used its three cut-outs. Branch on the code.
- 404
not_found_error - The requested resource does not exist.
- 409
conflict_error - The request conflicts with current state — e.g. your concurrent-batch cap is reached.
- 429
rate_limit_error - Too many requests. Slow down and retry.Retry-After: 30
- 500
api_error - An internal server error occurred (500), or a check your request needs could not run right now (503, e.g. moderation_unavailable or background_removal_unavailable). Retry later with backoff.
Limieten
- 600 verzoeken per minuut per account (Vast venster; de limiet is identiek op elk abonnement)
- Een 429 bevat Retry-After: 30 seconden
- Tot 10 MB per afbeelding
- Formaten: JPEG, PNG, WebP
- Gelijktijdige batches per abonnement: Free 1 · Hobby 2 · Seller 3 · Brand 4 · Studio 6
- Uitsluitend polling — de API stuurt geen webhooks.
Vijf stappen, één productfoto
Kies een mannequin, dien de taak in, poll tot hij klaar is, download het resultaat.
Stap 1
Genereer een API-key
Meld je aan op ai.photta.app, open het tabblad Developers en klik op Generate API key. Live keys beginnen met `photta_live_`. Plaats de sleutel in `PHOTTA_API_KEY` — commit deze nooit.
Stap 2
Kies een mannequin
GET `/api/v1/mannequins` om beschikbare modellen op te vragen en de gewenste ID te kiezen. Poses zijn per 2026-08-10 uitgefaseerd: elke foto toont een recht, naar de camera gericht volledig lichaam, dus er valt verder niets te kiezen.
Stap 3
POST de try-on-taak
Stuur een POST naar `/api/v1/tryon/apparel` met `product_type`, `product_images`, `mannequin_id` en optioneel `resolution` en `aspect_ratio`. De API retourneert 202 Accepted met een generatie-ID.
Stap 4
Poll totdat de taak is voltooid
GET `/api/v1/tryon/apparel/:id` elke 3 seconden. Zodra `data.status` verspringt naar `completed`, bevat de payload `output_url` en `thumbnail_url`. Stel een bovengrens in zodat een vastgelopen taak je request niet laat hangen.
Stap 5
Download en sla op
Haal de bytes op via `output_url` en sla ze op in je eigen object storage. De CDN-URL is stabiel, maar je product mag er niet van afhankelijk zijn voor rendering.
Hetzelfde endpoint in Node.js, Python en cURL
Node.js
Virtual try-on API in Node.js
Roep Photta's virtual try-on API aan vanuit een Node.js-backend met native fetch. Geen SDK vereist: sla je sleutel op, verzend de taak, poll voor het resultaat.
LezenPython
Virtual try-on API in Python
Roep Photta's virtual try-on API aan in Python met de requests-bibliotheek. Een wrapper van dertig regels, async-vriendelijk via httpx, werkt in Django, FastAPI en Celery.
LezencURL
Virtual try-on API met cURL
Roep Photta's virtual try-on API direct aan vanuit de shell met cURL. Verzenden, pollen, downloaden — elk fragment werkt naadloos samen met jq voor gescripte pipelines.
Lezen
Vragen die developers stellen voor ze apparel try-on shippen
Wat is Photta's virtuele try-on API?
Een REST-endpoint dat een flat-lay productafbeelding en een mannequin-ID accepteert en een fotorealistische afbeelding op een model retourneert. Dezelfde pipeline als Photta's consumenten-app. Vier producttypen worden ondersteund: top, bottom, top+bottom, one-piece.
Wat kost het per aanroep?
5 credits voor een 2K-resultaat, 6 credits voor 4K. Credits zijn inbegrepen bij je abonnement en kunnen worden opgewaardeerd. Mislukte generaties kosten geen credits — deze worden terugbetaald.
Hoe lang duurt een generatie?
Een gebruikelijke doorlooptijd is 1.5 tot 4 minuten, end-to-end gemeten. De POST retourneert binnen een seconde een generatie-ID; het GPU-werk vindt op de achtergrond plaats terwijl je pollt.
Welke producttypen worden ondersteund?
Vier: `top`, `bottom`, `top_and_bottom`, `one_piece`. Elk vereist een andere structuur voor `product_images` — zo verwacht `top_and_bottom` URL's voor zowel `top_image` als `bottom_image`.
Kan ik mijn eigen mannequin gebruiken?
Ja. Upload een mannequin-foto via `POST /api/v1/mannequins` of genereer een nieuwe AI-mannequin via `POST /api/v1/mannequins/generate`. Het geretourneerde ID koppel je direct aan het try-on-verzoek.
Hoe poll ik voor het resultaat?
GET `/api/v1/tryon/apparel/:id` elke 3 tot 5 seconden totdat `data.status` de waarde `completed` of `failed` heeft. Stel een maximumaantal pogingen in — 120 × 3s dekt de gedocumenteerde periode met marge.
Gerelateerde functionaliteiten
Mogelijkheden
Sieraden try-on API voor kettingen, ringen, armbanden en oorbellen
Plaats kettingen, ringen, armbanden en oorbellen op AI-modellen via REST. 5 credits bij 2K, ingebouwde close-up mannequins, reflectie-bewuste rendering uit de Photta-documentatie.
Bekijk het endpointMogelijkheden
Ghost mannequin API voor hollow-man-productfoto's
AI ghost mannequin endpoint. Verwijder de paspop uit een kledingfoto en behoud interne details. 3D of flat-lay, batchverwerking, 4 credits bij 2K.
Bekijk het endpointBouwen
Bouw een virtual try-on-feature voor je app
End-to-end recept voor het uitrollen van een virtual try-on-feature met de Photta API: uploaden, submitten, pollen vanuit een worker, resultaat renderen. TypeScript + server-only patronen.
Bekijk het endpointBouwen
Voeg virtual try-on toe aan een iOS- of Android-app
Hoe je met de Photta API virtuele AI-try-on toevoegt aan een native iOS- of Android-app: lever de key nooit mee naar het apparaat, proxy via je backend, spiegel de taakstatus.
Bekijk het endpointVergelijken
Photta vs FASHN — AI-mode-API, zij aan zij
Photta en FASHN vergeleken: endpoints, creditprijzen, abonnementsniveaus, concurrency-limieten. Afkomstig van de officiële prijzenpagina van elk bedrijf op 2026-04-19. Geen verzonnen cijfers.
Bekijk het endpointVergelijken
Photta vs Fitroom — kies de juiste match voor mode-API's
Photta en Fitroom vergeleken op endpoints, creditkosten per call, prijsmodel en integratie-oppervlak. Overgenomen van beide sites op 2026-04-19. Geen verzonnen cijfers.
Bekijk het endpointSnelstartgids
Eerste Photta-afbeelding in minder dan vijf minuten.
Registreer je, genereer een API-sleutel, voer je eerste cURL-call uit, poll totdat deze is voltooid, sla het resultaat op. Vijf stappen, end-to-end gedocumenteerd.
Bekijk het endpointReferentie
Photta API-fouten
De volledige lijst van Photta API-fouttypen met hun statuscodes, de structuur van een foutbody, en welke fouten het waard zijn om opnieuw te proberen.
Bekijk het endpointReferentie
Photta API rate limits
De Photta API rate limit, het bijbehorende venster, de Retry-After-header, het polling-interval en de gelijktijdigheidslimieten per abonnement, rechtstreeks uit de API-documentatie.
Bekijk het endpoint
Elk getal op deze pagina is afkomstig uit de Photta-API-documentatie · gecontroleerd
Probeer de API in vijf minuten
Genereer een Photta API-sleutel, plak het bovenstaande cURL-fragment en je hebt je eerste afbeelding op een model voordat de koffie klaar is.
- 1–1.5 min
- 5 credits bij 2K · 6 credits bij 4K
- async, polling
- 600 requests/min
- Bearer key