Funktion · Brillen-Studio

API für virtuelles Brillen-Try-on für Brillen und Sonnenbrillen

In aller Kürze

Phottas Brillen-Studio-API verwandelt ein einzelnes Foto einer Brille oder Sonnenbrille in eine fertige Aufnahme. Wählen Sie reines Produkt oder On-Model, führen Sie einen POST aus, pollen Sie alle 3 Sekunden und laden Sie das Ergebnis herunter, sobald der Status completed ist. 5 credits bei 2K.

  • Typische Dauer: 20–60 sec
  • 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/eyewear-studio
RESPONSE=$(curl -s -X POST https://api.photta.app/api/v1/eyewear-studio \
  -H "Authorization: Bearer $PHOTTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "eyewear_image": "https://cdn.yourstore.com/products/aviator-sunglasses.jpg",
  "mode": "product-only",
  "sub_tool": "studio-shot",
  "backdrop": "gradient",
  "lighting": "soft",
  "aspect_ratio": "3:4",
  "resolution": "2K"
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')
Sunglasses photographed by the eyewear studio API
Beispielausgabe

Auf einen Blick

Auf einen Blick

Endpoint
POST /api/v1/eyewear-studio
Authentifizierung
Bearer-API-Schlüssel
Verarbeitung
Asynchron — Polling über den Status-Endpoint
Typische Dauer
20–60 sec
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/eyewear-studio \
  -H "Authorization: Bearer $PHOTTA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "eyewear_image": "https://cdn.yourstore.com/products/aviator-sunglasses.jpg",
  "mode": "product-only",
  "sub_tool": "studio-shot",
  "backdrop": "gradient",
  "lighting": "soft",
  "aspect_ratio": "3:4",
  "resolution": "2K"
}')
ID=$(echo "$RESPONSE" | jq -r '.data.id')

202 Accepted / Abgeschlossen

{
  "data": {
    "id": "eyw_7a1c9e42f05b3d688c2e4f01a9d6b357",
    "status": "processing",
    "mode": "product-only",
    "sub_tool": "studio-shot",
    "resolution": "2K",
    "aspect_ratio": "3:4",
    "credits_used": 5,
    "created_at": "2026-08-01T09:15:00Z"
  },
  "request_id": "req_eyw001"
}

Request-Parameter

eyewear_image

Typ: stringErforderlich

The eyewear product image — glasses or sunglasses. https URL or base64 data URI. JPEG, PNG, WebP; max 10 MB.

mode

Typ: string

Generation mode: "product-only" — the eyewear alone, styled by sub_tool; "on-model" — the eyewear worn on an AI model's face (requires mannequin_id).

= product-only

Werte: product-onlyon-model
sub_tool

Typ: string

Product-only styling: "studio-shot" — clean studio product shot; "flat-lay" — top-down arrangement on a surface; "lifestyle" — the eyewear placed in a real-world scene; "floating" — the frames suspended mid-air. Sending sub_tool with mode "on-model" returns 400.

= studio-shot

Werte: studio-shotflat-laylifestylefloating
mannequin_id

Typ: string

Required when mode is "on-model": the AI model whose face wears the eyewear — an id ("mnk_...") from GET /api/v1/eyewear-studio/mannequins. Sending it in product-only mode returns 400.

face_angle

Typ: string

On-model only: the angle of the model's face.

= front

Werte: frontthree-quarterside-profile
expression

Typ: string

On-model only: the model's facial expression.

= neutral

Werte: neutralsoft-smileseriousconfident
lighting_style

Typ: string

On-model only: how the portrait is lit.

= soft-diffused

Werte: soft-diffusedstudionaturaldramatic
frame_fit_style

Typ: string

On-model only: the overall styling of how the frames are worn.

= casual

Werte: casualprofessionalfashion-editorialsporty
backdrop

Typ: string

Studio-shot only: the backdrop behind the eyewear.

= white

Werte: whitegrayblackgradient
lighting

Typ: string

Studio-shot only: the lighting setup.

= soft

Werte: softharddramaticnatural
surface

Typ: string

Flat-lay only: the surface the eyewear lies on.

= marble

Werte: marblewoodfabricconcretemetal
arrangement_style

Typ: string

Flat-lay only: how the composition is arranged.

= minimal

Werte: minimalsymmetricscatteredlayered
props

Typ: string

Flat-lay only: complementary props placed around the eyewear.

= none

Werte: noneplantsaccessoriestech
scene

Typ: string

Lifestyle only: the real-world setting.

= coffee-shop

Werte: coffee-shopbeachurban-streetofficepark
mood

Typ: string

Lifestyle only: the color mood of the scene.

= warm

Werte: warmcoolvibrantmoody
angle

Typ: string

Floating only: the camera angle on the suspended frames.

= front

Werte: frontthree-quartersidetop-down
shadow_style

Typ: string

Floating only: the shadow cast beneath the frames.

= soft-drop

Werte: soft-dropnonehard-dropreflection
background_color

Typ: string

Solid background color. Applies in both modes. Overridden by background_prompt when both are sent.

= white

Werte: whitegrayblackbeige
background_prompt

Typ: string

Free-text background description. Max 400 characters — excess is silently truncated. Overrides background_color.

aspect_ratio

Typ: string

Output aspect ratio.

= 3:4

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

Typ: string

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

= 2K

Werte: 2K4K

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.

Ein Fassungsfoto rein, eine gestylte Brillenaufnahme raus

Modus wählen, das vom Modus bereitgestellte Styling konfigurieren, absenden, pollen, herunterladen.

  1. Schritt 1

    API-Key generieren

    Das Brillen-Studio nutzt dieselben Anmeldedaten und dasselbe Guthaben an credits wie jede andere Photta-Funktion.

  2. Schritt 2

    Modus und Styling wählen

    `mode` ist `product-only` oder `on-model`. Product-only erfordert ein `sub_tool` — `studio-shot`, `flat-lay`, `lifestyle` oder `floating` — und jedes schaltet eigene Steuerungsparameter frei. On-model erfordert eine `mannequin_id` sowie `face_angle`, `expression`, `lighting_style` und `frame_fit_style`.

  3. Schritt 3

    Brillen-Job per POST senden

    Senden Sie einen POST an `/api/v1/eyewear-studio` mit `eyewear_image` und Ihren Styling-Feldern. `background_prompt` akzeptiert bis zu 400 Zeichen und überschreibt `background_color`. Polling ist das einzige Fertigstellungssignal — die API sendet keine Webhooks.

  4. Schritt 4

    Pollen, bis der Job abgeschlossen ist

    Führen Sie alle 3 Sekunden einen GET auf `/api/v1/eyewear-studio/:id` aus, bis `data.status` `completed` oder `failed` ist; typische Ausführungszeiten liegen zwischen 20 und 60 Sekunden.

  5. Schritt 5

    Herunterladen und dauerhaft speichern

    Der Body bei Fertigstellung enthält `output_url` und ein Thumbnail. Speichern Sie die Datei selbst — betrachten Sie die URL als Auslieferung eines einzelnen Jobs, nicht als permanentes Hosting.

Fragen, die Entwickler vor dem Produktivgang von Brillenaufnahmen stellen

Was macht die Brillen-Studio-API?

Sie nimmt ein einzelnes Produktfoto einer Brille oder Sonnenbrille entgegen und liefert ein gestyltes Foto davon zurück — entweder die Fassung allein im Studio-, Flat-Lay-, Lifestyle- oder Schwebestil oder getragen im Gesicht eines von Ihnen gewählten KI-Models.

Wie viel kostet eine Brillenaufnahme?

5 credits bei 2K und 6 credits bei 4K, genau wie beim Bekleidungs- und Schmuck-Try-on. Fehlgeschlagene Jobs werden automatisch erstattet.

Was ist der Unterschied zwischen product-only und on-model?

`product-only` fotografiert die Fassungen allein und wird über `sub_tool` gesteuert. `on-model` platziert sie im Gesicht eines KI-Models und wird über `mannequin_id`, `face_angle`, `expression`, `lighting_style` und `frame_fit_style` gesteuert. Felder des jeweils anderen Modus werden ignoriert.

Welche Styling-Optionen bietet jedes Sub-Tool?

`studio-shot` akzeptiert `backdrop` und `lighting`. `flat-lay` akzeptiert `surface`, `arrangement_style` und `props`. `lifestyle` akzeptiert `scene` und `mood`. `floating` akzeptiert `angle` und `shadow_style`. Jedes dieser Felder ist ein Enum; unerwartete Werte werden daher abgewiesen statt geraten.

Kann ich mein eigenes KI-Modell verwenden?

Ja. `mannequin_id` akzeptiert jede Mannequin-ID von GET `/api/v1/eyewear-studio/mannequins`, und Mannequins, die Sie mit der Mannequin-Generierungs-API erstellen, können auf die gleiche Weise verwendet werden.

Wie frage ich das Ergebnis per Polling ab?

GET `/api/v1/eyewear-studio/:id` alle 3 Sekunden aufrufen, bis `data.status` auf `completed` oder `failed` steht. Es gibt keine Webhooks; Polling ist das dokumentierte Signal für den Abschluss.

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.

  • 20–60 sec
  • 5 Credits bei 2K · 6 Credits bei 4K
  • asynchron, Polling
  • 600 Anfragen/Min.
  • Bearer-Key