Capability · Apparel
Virtuelle Try-on-API für Apparel
In aller Kürze
Phottas virtuelle Try-on-API nimmt ein Flat-Lay-Bekleidungsbild und eine Mannequin-ID entgegen und liefert ein 2K- oder 4K-Foto am Model zurück. Job per POST übermitteln, alle 3–5 Sekunden pollen, herunterladen, sobald der Status completed ist.
- Typische Dauer: 1–1.5 min
- Credits: 5 Credits bei 2K · 6 Credits bei 4K
- Verarbeitung: asynchron, Polling
- Limits: 600 Anfragen/Min.
- Authentifizierung: Bearer-Key
Jeder Zahlenwert auf dieser Seite stammt aus der Photta-API-Dokumentation · geprüft
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"]
Auf einen Blick
Auf einen Blick
- Endpoint
- POST /api/v1/tryon/apparel
- Authentifizierung
- Bearer-API-Schlüssel
- Verarbeitung
- Asynchron — Polling über den Status-Endpoint
- Typische Dauer
- 1–1.5 min
- Credits
- 5 Credits bei 2K · 6 Credits bei 4K
- Seitenverhältnisse
- 3:4 · 1:1 · 4:3 · 2:3 · 3:2 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9
- Eingabelimits
- Bis zu 10 MB pro Bild; JPEG, PNG, WebP
- Idempotent
- Ja
Request und 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 / Abgeschlossen
{
"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-Parameter
product_typeTyp: stringErforderlich
Type of garment.
Werte:topbottomtop_and_bottomone_pieceproduct_imagesTyp: array[string]Erforderlich
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_imageTyp: 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_imageTyp: string
Front image of the top garment. Required when product_type is "top_and_bottom".
top_back_imageTyp: string
Optional back image of the top garment. Sending one asks for a back shot, exactly as product_back_image does.
bottom_imageTyp: string
Front image of the bottom garment. Required when product_type is "top_and_bottom".
bottom_back_imageTyp: string
Optional back image of the bottom garment. Sending one asks for a back shot, exactly as product_back_image does.
mannequin_idTyp: stringErforderlich
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_colorTyp: 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.
Werte:whitelight_graygraycharcoalblackbeigecreamsandpose_idTyp: 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.
backgroundTyp: 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_backgroundTyp: 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
resolutionTyp: string
Output resolution.
= 2K
Werte:2K4Kaspect_ratioTyp: string
Output aspect ratio.
= 3:4
Werte:3:41:14:32:33:24:55:49:1616:921:9body_sizeTyp: 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
Werte:XSSMLXLXXLpetiteslimregularathleticcurvyplus_sizeexpressionTyp: string
Facial expression. `happy` and `smiling` are both a soft smile. An unknown value adds no expression to the prompt.
= neutral
Werte:neutralsoft_smileconfidentseriousrelaxedhappysmilingfootwear_urlTyp: 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_instructionTyp: 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_categoryTyp: 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_categoryTyp: string
Silhouette anchor for the top half. Only valid when product_type is "top_and_bottom".
bottom_categoryTyp: string
Silhouette anchor for the bottom half. Only valid when product_type is "top_and_bottom".
lengthTyp: 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}.
fitTyp: 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_lengthTyp: 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_fitTyp: 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_lengthTyp: 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_fitTyp: 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.
Fehler
- 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.
Limits
- 600 Anfragen pro Minute pro Konto (Festes Zeitfenster; das Limit ist in jedem Tarif identisch)
- Ein 429 enthält Retry-After: 30 Sekunden
- Bis zu 10 MB pro Bild
- Formate: JPEG, PNG, WebP
- Gleichzeitige Batches pro Tarif: Free 1 · Hobby 2 · Seller 3 · Brand 4 · Studio 6
- Nur Polling — die API sendet keine Webhooks.
Fünf Schritte, ein Produktfoto
Mannequin auswählen, Job übermitteln, pollem bis zur Fertigstellung, Ergebnis herunterladen.
Schritt 1
API-Key generieren
Auf ai.photta.app registrieren, den Tab „Developers“ öffnen und auf „Generate API key“ klicken. Live-Keys beginnen mit `photta_live_`. Den Key in `PHOTTA_API_KEY` hinterlegen — niemals committen.
Schritt 2
Mannequin auswählen
GET `/api/v1/mannequins` aufrufen, um verfügbare Models aufzulisten und die gewünschte ID zu übernehmen. Posen wurden am 2026-08-10 eingestellt: Jede Aufnahme ist eine gerade Ganzkörperaufnahme mit Blick in die Kamera, daher gibt es nichts weiter auszuwählen.
Schritt 3
Try-on-Job per POST übermitteln
Einen POST-Request an `/api/v1/tryon/apparel` senden mit `product_type`, `product_images`, `mannequin_id` sowie optional `resolution` und `aspect_ratio`. Die API antwortet mit 202 Accepted und einer Generations-ID.
Schritt 4
Poll durchführen, bis der Job abgeschlossen ist
Alle 3 Sekunden GET `/api/v1/tryon/apparel/:id` abfragen. Sobald `data.status` auf `completed` wechselt, enthält die Payload `output_url` und `thumbnail_url`. Ein oberes Limit setzen, damit ein hängender Job den Request nicht blockiert.
Schritt 5
Herunterladen und persistieren
Die Bytes von `output_url` abrufen und im eigenen Object Storage speichern. Die CDN-URL ist stabil, aber das eigene Produkt sollte für das Rendering nicht davon abhängen.
Derselbe Endpoint in Node.js, Python und cURL
Node.js
Virtuelle Try-on-API in Node.js
Rufen Sie Phottas virtuelle Try-on-API von einem Node.js-Backend mit nativem fetch auf. Kein SDK erforderlich: Key speichern, Job absenden, Ergebnis pollen.
LesenPython
Virtuelle Try-on-API in Python
Rufen Sie Phottas virtuelle Try-on-API in Python mit der requests-Bibliothek auf. Dreißigzeiliger Wrapper, async-kompatibel über httpx, funktioniert in Django, FastAPI und Celery.
LesencURL
Virtuelle Try-on-API mit cURL
Rufen Sie Phottas virtuelle Try-on-API direkt über die Shell mit cURL auf. Übermitteln, pollen, herunterladen — jedes Snippet lässt sich für skriptbasierte Pipelines mit jq kombinieren.
Lesen
Fragen, die Entwickler vor dem Rollout von Apparel Try-on stellen
Was ist die Virtual-Try-on-API von Photta?
Ein REST-Endpoint, der ein Flat-Lay-Produktbild und eine Mannequin-ID entgegennimmt und ein fotorealistisches On-Model-Bild zurückgibt. Dieselbe Pipeline wie in Phottas Consumer-App. Vier Produkttypen werden unterstützt: top, bottom, top+bottom, one-piece.
Wie viel kostet ein Aufruf?
5 credits für ein 2K-Ergebnis, 6 credits für 4K. Credits sind im Abonnement enthalten und können nachgeladen werden. Fehlgeschlagene Generationen kosten keine Credits — sie werden erstattet.
Wie lange dauert eine Generation?
Die typische Dauer liegt durchgängig gemessen bei 1.5 bis 4 Minuten. Der POST-Request liefert in unter einer Sekunde eine Generations-ID; die GPU-Verarbeitung läuft im Hintergrund, während gepollt wird.
Welche Produkttypen werden unterstützt?
Vier: `top`, `bottom`, `top_and_bottom`, `one_piece`. Jeder erwartet ein anderes Format für `product_images` — beispielsweise benötigt `top_and_bottom` URLs für `top_image` und `bottom_image`.
Kann ich ein eigenes Mannequin verwenden?
Ja. Ein Mannequin-Foto mit `POST /api/v1/mannequins` hochladen oder ein neues KI-Mannequin mit `POST /api/v1/mannequins/generate` erzeugen. Die zurückgegebene ID lässt sich direkt in den Try-on-Request einsetzen.
Wie polle ich nach dem Ergebnis?
Alle 3 bis 5 Sekunden GET `/api/v1/tryon/apparel/:id` abfragen, bis `data.status` `completed` oder `failed` lautet. Ein Limit für die Versuche festlegen — 120 × 3s deckt das dokumentierte Zeitfenster mit ausreichend Puffer ab.
Verwandte Funktionen
Funktionen
Jewelry-Try-on-API für Halsketten, Ringe, Armbänder und Ohrringe
Halsketten, Ringe, Armbänder und Ohrringe via REST auf KI-Modellen platzieren. 5 credits bei 2K, integrierte Nahaufnahme-Mannequins, reflexionsbewusstes Rendering aus der Photta-Dokumentation.
Zum EndpointFunktionen
Ghost-Mannequin-API für Hollow-Man-Produktfotos
KI-Ghost-Mannequin-Endpoint. Entfernt die Puppe aus einem Kleidungsfoto und bewahrt Innendetails. 3D oder Flat-Lay, Batch-Verarbeitung, 4 Credits bei 2K.
Zum EndpointBuild
Bauen Sie ein Virtual-Try-On-Feature für Ihre App
End-to-End-Rezept für die Implementierung eines Virtual-Try-On-Features mit der Photta API: Upload, Absenden, Polling über einen Worker, Rendern des Ergebnisses. TypeScript + Server-only-Muster.
Zum EndpointBuild
Virtuelles Try-On zu einer iOS- oder Android-App hinzufügen
So fügen Sie virtuelles KI-Try-On zu einer nativen iOS- oder Android-App mit der Photta-API hinzu: Liefern Sie den Key niemals an das Endgerät aus, leiten Sie Anfragen über Ihr Backend weiter und spiegeln Sie den Job-Status.
Zum EndpointVergleich
Photta vs FASHN — Fashion-KI-APIs im direkten Vergleich
Photta und FASHN im Vergleich: Endpoints, Credit-Preise, Tarifstufen, Concurrency-Limits. Direkt bezogen von den Preisseiten beider Unternehmen am 2026-04-19. Keine erfundenen Zahlen.
Zum EndpointVergleich
Photta vs. Fitroom — die passende Fashion-API auswählen
Photta und Fitroom im Vergleich nach Endpoints, Credit-Kosten pro Call, Preismodell und Integrationsfläche. Erhoben von den jeweiligen Websites am 2026-04-19. Keine erfundenen Zahlen.
Zum EndpointSchnellstart
Erstes Photta-Bild in unter 5 Minuten.
Registrieren, API-Key generieren, ersten cURL-Aufruf ausführen, pollen bis zum Abschluss, Ergebnis persistieren. 5 Schritte, durchgängig dokumentiert.
Zum EndpointReferenz
Photta API-Fehler
Die vollständige Liste der Photta API-Fehlertypen samt Statuscodes, das Format des Error-Bodys und welche Fehler sich für einen Retry eignen.
Zum EndpointReferenz
Photta API Rate Limits
Das Photta API Rate Limit, sein Zeitfenster, der Retry-After-Header, das Polling-Intervall und die tarifbasierten Concurrency-Limits, alles direkt aus der API-Dokumentation.
Zum Endpoint
Jeder Zahlenwert auf dieser Seite stammt aus der Photta-API-Dokumentation · geprüft
Testen Sie die API in fünf Minuten
Generieren Sie einen Photta-API-Schlüssel, fügen Sie das obige cURL-Snippet ein, und Sie erhalten Ihr erstes Bild am Model, noch bevor der Kaffee fertig gebrüht ist.
- 1–1.5 min
- 5 Credits bei 2K · 6 Credits bei 4K
- asynchron, Polling
- 600 Anfragen/Min.
- Bearer-Key