Capability · Apparel

Virtuelle Try-on-API für Apparel

In aller Kürze

Phottas virtuelle Try-on-API nimmt ein Flat-Lay-Bekleidungsbild, eine Mannequin-ID sowie eine Pose-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.5–4 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

POST/api/v1/tryon/apparel
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": "t_shirt",
  "mannequin_id": "mnk_f3a9b1",
  "pose_id": "pose_c2d4e5",
  "background": "https://cdn.yourstore.com/backgrounds/studio-loft.jpg",
  "lock_background": true,
  "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')
A garment rendered on an AI model by the apparel try-on API
Beispielausgabe

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.5–4 min
Credits
5 Credits bei 2K · 6 Credits bei 4K
Seitenverhältnisse
3:4 · 1:1 · 4:3 · 9:16 · 16:9
Eingabelimits
Bis zu 10 MB pro Bild; JPEG, PNG, WebP
Idempotent
Nein

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": "t_shirt",
  "mannequin_id": "mnk_f3a9b1",
  "pose_id": "pose_c2d4e5",
  "background": "https://cdn.yourstore.com/backgrounds/studio-loft.jpg",
  "lock_background": true,
  "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')

202 Accepted / Abgeschlossen

{
  "data": {
    "id": "try_abc123",
    "status": "processing",
    "product_type": "top",
    "mannequin_id": "mnk_f3a9b1",
    "pose_id": "pose_c2d4e5",
    "lock_background": true,
    "resolution": "2K",
    "aspect_ratio": "3:4",
    "credits_used": 5,
    "created_at": "2026-04-10T12:00:00Z"
  },
  "request_id": "req_xyz789"
}

Request-Parameter

product_type

Typ: stringErforderlich

Type of garment.

Werte: topbottomtop_and_bottomone_piece
product_images

Typ: 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_image

Typ: string

Optional URL or base64 data URI for the BACK of the garment. When supplied, the pipeline auto-switches to the back image whenever the selected pose is back-facing (Back / BackCloseUp). Not used when product_type is "top_and_bottom".

top_image

Typ: string

Front image of the top garment. Required when product_type is "top_and_bottom".

top_back_image

Typ: string

Optional back image of the top garment. Auto-selected on back-facing poses when present.

bottom_image

Typ: string

Front image of the bottom garment. Required when product_type is "top_and_bottom".

bottom_back_image

Typ: string

Optional back image of the bottom garment. Auto-selected on back-facing poses when present.

mannequin_id

Typ: stringErforderlich

ID of the mannequin to wear the garment. Use GET /api/v1/mannequins to list available options.

pose_id

Typ: stringErforderlich

ID of the pose. Use GET /api/v1/poses to list available options. The pose dictates the framing of the output — what's in frame, whether the face/feet are visible, full body vs half body, etc.

background

Typ: string

Optional URL or base64 data URI to a background photo. Anything that is not a URL or data: URI is rejected with HTTP 400. When omitted, an editorial neutral backdrop is used.

lock_background

Typ: boolean

When true, the supplied background image is reproduced faithfully (locked) instead of being treated as loose inspiration. Requires the background field — returns 400 if set without a background. Echoed back in the response object.

= false

resolution

Typ: string

Output resolution. 4K cannot be combined with aspect_ratio 1:1 — that combination returns 400.

= 2K

Werte: 2K4K
aspect_ratio

Typ: string

Output aspect ratio. 1:1 cannot be combined with resolution 4K — that combination returns 400.

= 3:4

Werte: 3:41:14:39:1616:9
body_size

Typ: string

Body size of the mannequin.

= M

Werte: XSSMLXLXXL
expression

Typ: string

Facial expression.

= neutral

Werte: neutralhappyserioussmiling
footwear_url

Typ: string

URL or base64 of a custom footwear image. The pipeline always stages the footwear when supplied; the prompt's pose-authority block decides whether to render it (poses that don't show feet drop it cleanly).

user_instruction

Typ: 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_category

Typ: string

Optional silhouette anchor for the garment (e.g. "t_shirt", "jeans", "blazer", "midi_dress"). Helps disambiguate the structure of the garment when the silhouette is ambiguous from the photo alone. Used for product_type "top", "bottom", and "one_piece".

top_category

Typ: string

Silhouette anchor for the top half. Only valid when product_type is "top_and_bottom".

bottom_category

Typ: string

Silhouette anchor for the bottom half. Only valid when product_type is "top_and_bottom".

length

Typ: 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}.

fit

Typ: 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_length

Typ: 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_fit

Typ: 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_length

Typ: 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_fit

Typ: 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

400invalid_request_error
The request is malformed or contains invalid parameters.
401authentication_error
The API key is missing, invalid, or expired.
402insufficient_credits_error
Your account does not have enough credits.
404not_found_error
The requested resource does not exist.
409conflict_error
The request conflicts with current state — e.g. your concurrent-batch cap is reached.
429rate_limit_error
Too many requests. Slow down and retry.Retry-After: 30
500api_error
An internal server error occurred. Retry later.

Limits

  • 600 Anfragen pro Minute pro API-Schlüssel (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.

  1. 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.

  2. Schritt 2

    Mannequin und Pose auswählen

    GET `/api/v1/mannequins` aufrufen, um verfügbare Optionen aufzulisten. GET `/api/v1/poses` für den Bildausschnitt. Beide IDs gehören in den Try-on-Request.

  3. Schritt 3

    Try-on-Job per POST übermitteln

    Einen POST-Request an `/api/v1/tryon/apparel` senden mit `product_type`, `product_images`, `mannequin_id`, `pose_id` sowie optional `resolution` und `aspect_ratio`. Die API antwortet mit 202 Accepted und einer Generations-ID.

  4. 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.

  5. 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.

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

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.5–4 min
  • 5 Credits bei 2K · 6 Credits bei 4K
  • asynchron, Polling
  • 600 Anfragen/Min.
  • Bearer-Key