Capability · Eyewear studio

Eyewear virtual try-on API for glasses and sunglasses

In one sentence

Photta’s eyewear studio API turns one photo of glasses or sunglasses into a finished shot. Pick product-only or on-model, POST, poll every 3 seconds, download when the status is completed. 5 credits at 2K.

  • Typical time: 20–60 sec
  • Credits: 5 credits at 2K · 6 credits at 4K
  • Processing: async, polling
  • Limits: 600 requests/min
  • Authentication: Bearer key

Every figure on this page comes from the Photta API docs · checked

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
Example output

At a glance

At a glance

Endpoint
POST /api/v1/eyewear-studio
Authentication
Bearer API key
Processing
Asynchronous — poll the status endpoint
Typical time
20–60 sec
Credits
5 credits at 2K · 6 credits at 4K
Aspect ratios
3:4 · 1:1 · 4:3 · 2:3 · 3:2 · 4:5 · 5:4 · 9:16 · 16:9 · 21:9
Input limits
Up to 10 MB per image; JPEG, PNG, WebP
Idempotent
No

Request and 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 / Completed

{
  "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 parameters

eyewear_image

Type: stringRequired

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

mode

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

Values: product-onlyon-model
sub_tool

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

Values: studio-shotflat-laylifestylefloating
mannequin_id

Type: 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, which lists faces only: an id of a model photographed for jewellery (a hand, wrist, ear or neck) returns 400. Sending it in product-only mode returns 400.

face_angle

Type: string

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

= front

Values: frontthree-quarterside-profile
expression

Type: string

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

= neutral

Values: neutralsoft-smileseriousconfident
lighting_style

Type: string

On-model only: how the portrait is lit.

= soft-diffused

Values: soft-diffusedstudionaturaldramatic
frame_fit_style

Type: string

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

= casual

Values: casualprofessionalfashion-editorialsporty
backdrop

Type: string

Studio-shot only: the backdrop behind the eyewear.

= white

Values: whitegrayblackgradient
lighting

Type: string

Studio-shot only: the lighting setup.

= soft

Values: softharddramaticnatural
surface

Type: string

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

= marble

Values: marblewoodfabricconcretemetal
arrangement_style

Type: string

Flat-lay only: how the composition is arranged.

= minimal

Values: minimalsymmetricscatteredlayered
props

Type: string

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

= none

Values: noneplantsaccessoriestech
scene

Type: string

Lifestyle only: the real-world setting.

= coffee-shop

Values: coffee-shopbeachurban-streetofficepark
mood

Type: string

Lifestyle only: the color mood of the scene.

= warm

Values: warmcoolvibrantmoody
angle

Type: string

Floating only: the camera angle on the suspended frames.

= front

Values: frontthree-quartersidetop-down
shadow_style

Type: string

Floating only: the shadow cast beneath the frames.

= soft-drop

Values: soft-dropnonehard-dropreflection
background_color

Type: string

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

= white

Values: whitegrayblackbeige
background_prompt

Type: string

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

aspect_ratio

Type: string

Output aspect ratio.

= 3:4

Values: 3:41:14:32:33:24:55:49:1616:921:9
resolution

Type: string

Output resolution.

= 2K

Values: 2K4K

Errors

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 (500), or a check your request needs could not run right now (503, e.g. moderation_unavailable). Retry later with backoff.

Limits

  • 600 requests per minute per account (Fixed window; the limit is the same on every plan)
  • A 429 carries Retry-After: 30 seconds
  • Up to 10 MB per image
  • Formats: JPEG, PNG, WebP
  • Concurrent batches per plan: Free 1 · Hobby 2 · Seller 3 · Brand 4 · Studio 6
  • Polling only — the API sends no webhooks.

One frame photo in, one styled eyewear shot out

Pick a mode, choose the styling that mode exposes, submit, poll, download.

  1. Step 1

    Generate an API key

    The eyewear studio uses the same credentials and the same credit balance as every other Photta capability.

  2. Step 2

    Pick a mode and its styling

    `mode` is `product-only` or `on-model`. Product-only takes a `sub_tool` — `studio-shot`, `flat-lay`, `lifestyle` or `floating` — and each one opens its own controls. On-model takes a `mannequin_id` plus `face_angle`, `expression`, `lighting_style` and `frame_fit_style`.

  3. Step 3

    POST the eyewear job

    POST to `/api/v1/eyewear-studio` with `eyewear_image` and your styling fields. `background_prompt` accepts up to 400 characters and overrides `background_color`. Polling is the only completion signal — the API sends no webhooks.

  4. Step 4

    Poll until the job completes

    GET `/api/v1/eyewear-studio/:id` every 3 seconds until `data.status` is `completed` or `failed`; typical completion is 20 to 60 seconds.

  5. Step 5

    Download and persist

    The completed body carries `output_url` and a thumbnail. Store the file yourself — treat the URL as the delivery of one job, not as permanent hosting.

Questions developers ask before shipping eyewear shots

What does the eyewear studio API do?

It takes one product photo of glasses or sunglasses and returns a styled photograph of them — either the frames alone in a studio, flat-lay, lifestyle or floating treatment, or worn on the face of an AI model you choose.

How much does an eyewear shot cost?

5 credits at 2K and 6 credits at 4K, the same as apparel and jewelry try-on. Failed jobs refund automatically.

What is the difference between product-only and on-model?

`product-only` photographs the frames by themselves and is driven by `sub_tool`. `on-model` puts them on an AI model’s face and is driven by `mannequin_id`, `face_angle`, `expression`, `lighting_style` and `frame_fit_style`. Fields belonging to the other mode are ignored.

Which styling options does each sub-tool expose?

`studio-shot` takes `backdrop` and `lighting`. `flat-lay` takes `surface`, `arrangement_style` and `props`. `lifestyle` takes `scene` and `mood`. `floating` takes `angle` and `shadow_style`. Every one of those fields is an enum, so an unexpected value is rejected rather than guessed.

Can I use my own AI model?

Yes. `mannequin_id` accepts any mannequin id from GET `/api/v1/eyewear-studio/mannequins`, and mannequins you build with the mannequin generation API can be used the same way.

How do I poll for the result?

GET `/api/v1/eyewear-studio/:id` every 3 seconds until `data.status` is `completed` or `failed`. There are no webhooks; polling is the documented completion signal.

Related capabilities

Every figure on this page comes from the Photta API docs · checked

Try the API in five minutes

Generate a Photta API key, paste the cURL snippet above, and you'll have your first on-model image before the coffee finishes brewing.

  • 20–60 sec
  • 5 credits at 2K · 6 credits at 4K
  • async, polling
  • 600 requests/min
  • Bearer key