Guide · Virtual try-on

What is a virtual try-on API? and what it returns

In one sentence

A virtual try-on API takes a garment photograph and returns an image of that garment worn by a model. You POST the photo with a mannequin and a pose, poll the job, then download the result.

  • Typical time: 1.5–4 min
  • Credits: 5 credits at 2K · 6 credits at 4K
  • Processing: async, polling

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

The short answer

A virtual try-on API is an HTTP endpoint that renders a garment onto a model. You send a photograph of the product — usually the flat or on-mannequin shot you already have — and the service returns an image of that garment being worn. No studio, no model booking, no reshoot when the colourway changes.

The call is asynchronous because rendering takes longer than a request should wait. You POST the garment with the model and pose you want, the API accepts the job and hands back an id, and you poll a status endpoint until the job reports that it is complete. The finished image arrives as a URL you download and store yourself.

The usual callers are catalogue teams that need on-model imagery for products that never reach a studio, marketplaces that receive flat photographs from sellers, and apps that let a shopper see a garment on a body other than the brand’s single fit model.

The endpoint that does it

Read from the Photta API documentation, not written by hand.

At a glance

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

What to look for in any try-on API

  • What you send

    A garment photograph as an https URL or a base64 data URI, plus the model and pose you want. Photta accepts JPEG, PNG and WebP up to 10 MB per image.

  • How long it takes

    Long enough that it cannot be done inside a web request. Photta publishes a typical completion time per endpoint and expects polling every 3 seconds — there are no webhooks.

  • What it costs

    Photta charges credits per call, 5 at 2K and 6 at 4K for apparel try-on, deducted when the job starts and refunded automatically when it fails.

  • What limits apply

    A published rate limit of 600 requests per minute per key, and a per-plan cap on how much can render at once. Both are worth reading before a catalogue-sized run.

The first request

The same call in cURL, Node.js and Python.

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')

Questions about virtual try-on APIs

What does a try-on API return?

An image of the garment worn by the model you chose, delivered as a URL in the completed job. Download and store it — a delivery URL is not permanent hosting.

Do I need a photo of a model?

No. Photta ships a mannequin catalogue you pick from, and you can generate your own model from attributes or upload one. The garment photograph is the only image you must supply.

How is this different from a virtual fitting room?

A fitting room is a shopper-facing feature. A try-on API is the render step underneath it: one call in, one image out. You can build a fitting room on top, or use it purely to produce catalogue photography.

What does a try-on call cost?

With Photta, 5 credits at 2K and 6 at 4K. Failed jobs are refunded, so the cost of a retry is the retry itself.

How long does one image take?

The endpoint publishes its typical completion time, and the job reports its own status. Poll every 3 seconds rather than assuming a duration.

Try it on your own product photo

One request, one poll, one image.

  • 1.5–4 min
  • 5 credits at 2K · 6 credits at 4K
  • async, polling