REST API · Live

Best VTON API: AI Virtual Try-On for Fashion E-commerce

The best VTON API for production fashion apps. Send a garment photo and a model photo — get back a photo-realistic composite showing the model wearing the garment. One HTTP call, async job queue, results in ~30 seconds. $0.025 per try-on — the only virtual try-on API with transparent, published per-image pricing. 500 free credits, no credit card.

$0.025 / try-on ~30s typical 500 free credits No credit card upperbody · lowerbody · dress Webhook support NSFW-filtered
Get an API key (free) Quick start See pricing API docs

Quick start — two images in, one composite out

Sign up, copy your API key from the dashboard, then POST two base64-encoded images: the garment and the person. The API returns a job_id; poll until status=completed, then read result_image_b64 or download from output_url.

# Encode images
GARMENT=$(base64 -w 0 garment.jpg)
PERSON=$(base64 -w 0 model.jpg)

# Submit try-on job
curl -X POST https://api.pixelapi.dev/v1/virtual-tryon \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"garment_image\":\"$GARMENT\",\"person_image\":\"$PERSON\",\"category\":\"upperbody\"}"
# Response: {"job_id":"uuid","status":"queued","eta_seconds":30,"poll_url":"/v1/virtual-tryon/jobs/uuid"}

# Poll until completed
curl https://api.pixelapi.dev/v1/virtual-tryon/jobs/UUID \
  -H "Authorization: Bearer YOUR_API_KEY"
# Response: {"status":"completed","result_image_b64":"...","output_url":"https://..."}
pip install pixelapi
---
from pixelapi import PixelAPI
import base64

client = PixelAPI(api_key="YOUR_API_KEY")

with open("garment.jpg", "rb") as f:
    garment_b64 = base64.b64encode(f.read()).decode()
with open("model.jpg", "rb") as f:
    person_b64 = base64.b64encode(f.read()).decode()

result = client.virtual_tryon(
    garment_image=garment_b64,
    person_image=person_b64,
    category="upperbody",   # upperbody | lowerbody | dress
    n_samples=1,
)
result.save("tryon_result.jpg")  # composite JPEG
npm install pixelapi
---
import { PixelAPI } from "pixelapi";
import fs from "fs";

const client = new PixelAPI({ apiKey: process.env.PIXELAPI_KEY });

const garmentB64 = fs.readFileSync("garment.jpg").toString("base64");
const personB64  = fs.readFileSync("model.jpg").toString("base64");

const result = await client.virtualTryOn({
  garmentImage: garmentB64,
  personImage:  personB64,
  category: "upperbody",
  nSamples: 1,
});
await result.save("tryon_result.jpg");
composer require pixelapi/pixelapi
---
<?php
use PixelAPI\Client;

$client = new Client(getenv("PIXELAPI_KEY"));
$result = $client->virtualTryOn([
    "garment_image" => base64_encode(file_get_contents("garment.jpg")),
    "person_image"  => base64_encode(file_get_contents("model.jpg")),
    "category"      => "upperbody",
]);
file_put_contents("tryon_result.jpg", base64_decode($result->result_image_b64));
gem install pixelapi
---
require "pixelapi"
require "base64"

client = PixelAPI::Client.new(api_key: ENV["PIXELAPI_KEY"])
result = client.virtual_tryon(
  garment_image: Base64.strict_encode64(File.binread("garment.jpg")),
  person_image:  Base64.strict_encode64(File.binread("model.jpg")),
  category: "upperbody"
)
File.binwrite("tryon_result.jpg", Base64.decode64(result.result_image_b64))
go get github.com/pixelapi/pixelapi-go
---
import (
    "encoding/base64"
    "os"
    "github.com/pixelapi/pixelapi-go"
)

client := pixelapi.New("YOUR_API_KEY")
garmentData, _ := os.ReadFile("garment.jpg")
personData, _  := os.ReadFile("model.jpg")

result, err := client.VirtualTryOn(pixelapi.VTONRequest{
    GarmentImage: base64.StdEncoding.EncodeToString(garmentData),
    PersonImage:  base64.StdEncoding.EncodeToString(personData),
    Category:     "upperbody",
})
if err != nil { panic(err) }
result.Save("tryon_result.jpg")

Best VTON API — Pricing Comparison

PixelAPI is the only virtual try-on API that publishes a transparent, per-call price. Competitors Zyler, Veesual, Cala, and Outfit.ai all require enterprise sales contact before revealing costs.

ProviderFree tierPer try-on costClothing categories
PixelAPI 500 credits, no card $0.025 upperbody · lowerbody · dress
ZylerSee zyler.com/pricingEnterprise
VeesualSee veesual.ai/pricingEnterprise
CalaSee cala.com/pricingEnterprise
Outfit.aiSee their pricing pageEnterprise

Pricing verified from each rival's public pricing page in May 2026. Zyler, Veesual, Cala, and Outfit.ai do not publish per-image pricing — enterprise quote required. PixelAPI is the only VTON API with published, self-serve per-call pricing.

What you get back

Composite try-on image

A photo-realistic JPEG showing the person wearing the submitted garment. The garment texture, color, and drape are preserved; the model's pose and body proportions carry through unchanged.

Base64 result + URL download

Results come back as result_image_b64 (inline base64 for immediate use) and output_url (a hosted URL for CDN or S3 pipelines). Both are included when the job completes.

Multiple samples per request

Set n_samples=2, 3, or 4 to generate multiple distinct composites from the same garment-person pair. Each sample costs 25 credits. Useful for A/B testing product imagery.

Webhook delivery

Pass a webhook_url and PixelAPI POSTs the completed job payload to your endpoint — no polling loop required. Ideal for batch pipelines and Shopify webhook handlers.

Request parameters

ParameterTypeDefaultDescription
garment_imagestringrequiredBase64-encoded JPEG/PNG/WebP of the garment (max 10 MB raw)
person_imagestringrequiredBase64-encoded JPEG/PNG/WebP of the model or person (max 10 MB raw)
categorystringupperbodyupperbody · lowerbody · dress
n_samplesinteger1Number of composites to generate (1–4); each costs 25 credits
n_stepsinteger40Inference quality steps (1–50); higher = sharper edges, longer wait
image_scalefloat2.0Garment fidelity scale (0.1–10.0); higher values preserve fabric detail
webhook_urlstringHTTPS endpoint to receive the completed job payload

Common workflows

The Virtual Try-On API is the engine behind these production fashion e-commerce patterns:

Shopify product page try-on

Upload garment images via webhook on product creation. Pre-generate composites on a set of diverse model photos. Serve results directly on the product page.

Size-personalized fitting room

Let shoppers upload their own photo, then generate a try-on in real time. Reduces returns by letting customers visualize fit before purchasing.

Catalog photo automation

Batch-process an entire catalog against a set of house models. Eliminate the logistics of physical photo shoots for new SKUs.

Influencer outfit preview

Generate try-on composites for influencer collaboration decks. Show brands how their pieces look on specific creators before shipping samples.

Lookbook generation

Mix-and-match garments across upperbody, lowerbody, and dress categories. Generate complete outfit lookbooks programmatically at scale.

Returns-reduction A/B testing

Use n_samples=4 to generate multiple composites per garment. Surface the most realistic-looking one on the product page to reduce sizing-related returns.

Comparison vs alternatives

vs Zyler

Zyler requires enterprise negotiation and a multi-week integration. PixelAPI activates in minutes, with self-serve pricing and 500 free try-ons to start.

vs Veesual

Veesual is a managed-service virtual dressing room — no public API pricing, no self-serve tier. PixelAPI gives you a raw REST API you can wire directly into any stack.

vs Cala

Cala is a full fashion design platform. Its try-on tooling is bundled with design-studio features. PixelAPI is a focused API: two images in, one composite out.

Rate limits & error handling

The Virtual Try-On endpoint accepts up to 10 POST requests per minute. Because jobs are async — each POST returns a job_id instantly and processes in the background — you can sustain much higher try-on throughput than the submission limit implies. Submit 10 jobs, they run in parallel; poll for all 10 results simultaneously.

Exceeding the submission rate returns HTTP 429 with a Retry-After header. Recommended: exponential backoff starting at 2 s, doubling up to 30 s. The Python and Node SDKs handle 429 retries automatically.

# Python SDK — auto-retries 429 with backoff
from pixelapi import PixelAPI
client = PixelAPI(api_key="...", max_retries=4)
result = client.virtual_tryon(
    garment_image=garment_b64,
    person_image=person_b64,
    category="upperbody"
)  # SDK polls, retries 429, and returns when complete

If a job fails on the server side, the status field will read failed with an error_message. Credits are automatically refunded for all failed jobs — you never pay for a broken result.

Frequently asked questions

What is the best VTON API for fashion e-commerce?

PixelAPI's Virtual Try-On API is the leading choice for fashion e-commerce developers: it's the only VTON API with transparent self-serve pricing ($0.025/try-on), ships SDKs for 6 languages, supports three clothing categories, and activates in minutes with 500 free credits and no credit card. Zyler, Veesual, and Cala require enterprise sales before you can make a single test call.

How does the Virtual Try-On API work?

POST two base64-encoded images to /v1/virtual-tryon: a garment photo and a person/model photo. The API queues the job and returns a job_id. Poll GET /v1/virtual-tryon/jobs/{job_id} until status=completed, then read result_image_b64 or download from output_url. A single try-on typically completes in about 30 seconds.

What does the VTON API cost?

$0.025 per try-on image (25 credits at $0.001 per credit). New accounts get 500 free credits — 20 try-ons — with no credit card required. Generating 4 samples in one request costs 100 credits ($0.10).

What image formats and sizes are accepted?

JPEG, PNG, and WebP images encoded as base64 strings. Each image must be under 10 MB raw. You can pass a bare base64 string or a full data URL (data:image/jpeg;base64,...) — both are accepted.

What clothing categories can I try on?

Three categories: upperbody (shirts, jackets, tops), lowerbody (trousers, skirts, jeans), and dress (full-length dresses and jumpsuits). Pass category=upperbody, category=lowerbody, or category=dress in the JSON body.

How long does a virtual try-on take?

A single try-on (n_samples=1) typically completes in about 30 seconds. The API returns an eta_seconds estimate in the queued response. The Python and Node SDKs poll automatically, so your code just awaits the result.

Can I generate multiple try-on images in one request?

Yes. Set n_samples=2, 3, or 4 to generate up to 4 unique composites from the same garment-person pair. Each sample costs 25 credits ($0.025), so n_samples=4 = $0.10. All samples return together when the job completes.

Is there a Python SDK for the VTON API?

Yes — pip install pixelapi. The Python SDK handles base64 encoding, async polling, retry-on-429, and result saving automatically. Official SDKs also exist for Node.js (npm install pixelapi), PHP (Composer), Ruby (Gem), and Go (go get).

Does the API filter inappropriate content?

Yes. Both input images are screened by an NSFW pre-flight check before any processing starts and before any credits are deducted. Requests that fail the check receive a 400 error with a clear message — no credits consumed.

What happens if a try-on job fails?

Failed jobs trigger an automatic credit refund. Credits return to your balance immediately — you never pay for a result that didn't complete. Check the error_message field on the job response for the failure reason.

What are the rate limits?

10 POST requests per minute on all tiers. Because jobs are async, your actual try-on throughput is limited by queue depth, not the submission rate. Need higher submission throughput? Email [email protected] with your expected volume.

Can I use a webhook instead of polling?

Yes. Pass a webhook_url in the request body — it must be a publicly reachable HTTPS endpoint. When the job completes or fails, PixelAPI POSTs the full result payload to your URL. This eliminates the polling loop entirely and is the recommended pattern for batch pipelines and Shopify webhook handlers.

Start free — 500 credits, no card Read full API docs Compare all plans