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
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')const res = await fetch("https://api.photta.app/api/v1/eyewear-studio", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"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"
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/eyewear-studio",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"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"
},
)
data = res.json()["data"] # data["id"], data["status"]
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')const res = await fetch("https://api.photta.app/api/v1/eyewear-studio", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.PHOTTA_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"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"
}),
});
const { data } = await res.json(); // data.id, data.statusimport os, requests
res = requests.post(
"https://api.photta.app/api/v1/eyewear-studio",
headers={"Authorization": f"Bearer {os.environ['PHOTTA_API_KEY']}"},
json={
"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"
},
)
data = res.json()["data"] # data["id"], data["status"]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"
}{
"data": {
"id": "eyw_7a1c9e42f05b3d688c2e4f01a9d6b357",
"status": "completed",
"mode": "product-only",
"sub_tool": "studio-shot",
"output_url": "https://cdn.photta.app/generated/eyw_7a1c9e42f05b3d688c2e4f01a9d6b357.jpg",
"thumbnail_url": "https://cdn.photta.app/generated/eyw_7a1c9e42f05b3d688c2e4f01a9d6b357-thumb.jpg",
"resolution": "2K",
"aspect_ratio": "3:4",
"credits_used": 5,
"created_at": "2026-08-01T09:15:00Z",
"completed_at": "2026-08-01T09:15:38Z"
},
"request_id": "req_eyw002"
}Request parameters
eyewear_imageType: stringRequired
The eyewear product image — glasses or sunglasses. https URL or base64 data URI. JPEG, PNG, WebP; max 10 MB.
modeType: 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-modelsub_toolType: 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-laylifestylefloatingmannequin_idType: 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_angleType: string
On-model only: the angle of the model's face.
= front
Values:frontthree-quarterside-profileexpressionType: string
On-model only: the model's facial expression.
= neutral
Values:neutralsoft-smileseriousconfidentlighting_styleType: string
On-model only: how the portrait is lit.
= soft-diffused
Values:soft-diffusedstudionaturaldramaticframe_fit_styleType: string
On-model only: the overall styling of how the frames are worn.
= casual
Values:casualprofessionalfashion-editorialsportybackdropType: string
Studio-shot only: the backdrop behind the eyewear.
= white
Values:whitegrayblackgradientlightingType: string
Studio-shot only: the lighting setup.
= soft
Values:softharddramaticnaturalsurfaceType: string
Flat-lay only: the surface the eyewear lies on.
= marble
Values:marblewoodfabricconcretemetalarrangement_styleType: string
Flat-lay only: how the composition is arranged.
= minimal
Values:minimalsymmetricscatteredlayeredpropsType: string
Flat-lay only: complementary props placed around the eyewear.
= none
Values:noneplantsaccessoriestechsceneType: string
Lifestyle only: the real-world setting.
= coffee-shop
Values:coffee-shopbeachurban-streetofficeparkmoodType: string
Lifestyle only: the color mood of the scene.
= warm
Values:warmcoolvibrantmoodyangleType: string
Floating only: the camera angle on the suspended frames.
= front
Values:frontthree-quartersidetop-downshadow_styleType: string
Floating only: the shadow cast beneath the frames.
= soft-drop
Values:soft-dropnonehard-dropreflectionbackground_colorType: string
Solid background color. Applies in both modes. Overridden by background_prompt when both are sent.
= white
Values:whitegrayblackbeigebackground_promptType: string
Free-text background description. Max 400 characters — excess is silently truncated. Overrides background_color.
aspect_ratioType: string
Output aspect ratio.
= 3:4
Values:3:41:14:32:33:24:55:49:1616:921:9resolutionType: string
Output resolution.
= 2K
Values:2K4K
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.
- 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). 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.
Step 1
Generate an API key
The eyewear studio uses the same credentials and the same credit balance as every other Photta capability.
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`.
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.
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.
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.
The same endpoint in Node.js, Python and cURL
Node.js
Eyewear virtual try-on API in Node.js
Call Photta's eyewear virtual try-on API from a Node.js backend with native fetch. No SDK required: store your key, submit the job, poll for the result.
ReadPython
Eyewear virtual try-on API in Python
Call Photta's eyewear virtual try-on API in Python with the requests library. Thirty-line wrapper, async-friendly via httpx, works in Django, FastAPI and Celery.
ReadcURL
Eyewear virtual try-on API with cURL
Call Photta's eyewear virtual try-on API directly from the shell with cURL. Submit, poll, download — every snippet pairs with jq for scripted pipelines.
Read
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
Capabilities
Virtual try-on API for apparel
REST API that places apparel on AI mannequins. Asynchronous, 1.5–4 minute generation, 5 credits at 2K, 6 at 4K. cURL, Node.js and Python examples.
See the endpointCapabilities
Jewelry try-on API for necklaces, rings, bracelets and earrings
Place necklaces, rings, bracelets and earrings on AI models via REST. 5 credits at 2K, close-up mannequins built-in, reflection-aware rendering from the Photta docs.
See the endpointBuild
Build an AI product photography service
A founder's playbook for reselling Photta's virtual try-on API as a white-label SaaS: tenant keys, batch fanout, per-credit billing, SLA reality.
See the endpointCompare
Photta vs FASHN — AI fashion API, side by side
Photta and FASHN compared: endpoints, credit pricing, plan tiers, concurrency limits. Sourced from each company's own pricing page on 2026-04-19. No invented numbers.
See the endpointQuickstart
First Photta image in under five minutes.
Sign up, generate an API key, run your first cURL call, poll until it completes, persist the result. Five steps, documented end-to-end.
See the endpointReference
Photta API errors
The full list of Photta API error types with their status codes, the shape of an error body, and which failures are worth retrying.
See the endpointReference
Photta API rate limits
The Photta API rate limit, its window, the Retry-After header, the polling interval and the per-plan concurrency caps, all read from the API documentation.
See the endpoint
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