Get started
Introduction
Add AI virtual try-on to any store or app: send a photo of the shopper and an image of a garment, and get back a photo of the shopper wearing it.
On Shopify or WooCommerce you don't need any of this — install the app or plugin and the try-on button is added for you. The API is for everything else: custom storefronts, headless commerce, mobile apps and in-house tools.
Basics
| Base URL | https://fabricvton-api.onrender.com/api/v1 |
| Auth | Authorization: Bearer clothsy_live_… on every request. Create your key in the Clothsy AI platform under Developer API. |
| Price | 1 credit per finished try-on. A try-on that fails is refunded automatically. Your first key comes with 20 free credits, once per account. |
| Images | JPEG or PNG, up to 4 MB each. Upload a file to get an id that works for 24 hours, or pass a public HTTPS URL. |
| Getting the result | Start a try-on and poll for it, or use the sync endpoint, which waits up to about 55 seconds and returns the finished image in the same call. |
| SDK | clothsy-ai for TypeScript and JavaScript, with a ready-made Next.js route and button. Or call the HTTP API from any language. |
| Speed | Most results are ready in under 30 seconds. |
| Errors | JSON { error, code }. Branch on code. See Errors & limits. |
| Where to call it | From your server only. Your key must never reach a browser or a mobile app bundle. |
How it works
- Upload the photo (optional).
POST /imageswith the shopper's photo file returns animg_…id. Skip this if the photo already has a public HTTPS URL. - Start the try-on.
POST /tryonswith the shopper's photo and the garment image — each as an uploaded id or a URL — plusconsent: true. You get anidback straight away. - Poll it.
GET /tryons/{id}every 2–3 seconds untilstatusissuccessorfailed. - Show the result.
resultUrlis an image your shopper's browser can load directly for the next 24 hours.
With the SDK, the whole flow is a few lines:
import { Clothsy } from "clothsy-ai";
const clothsy = new Clothsy(); // reads CLOTHSY_API_KEY
const photo = await clothsy.images.upload(photoBytes, { contentType: "image/jpeg" });
const tryon = await clothsy.tryons.run({
person: { imageId: photo.id },
garment: { url: product.imageUrl },
title: product.title,
consent: true,
});
console.log(tryon.resultUrl);Every result carries a machine-readable label saying it was made with AI. AI content label explains it, and why you should also say so on screen.
Send the product title. A title such as “Cropped denim jacket” tells the engine what kind of garment it is placing, which gives better results than an image alone.
What you need
- A Clothsy AI account and an API key — sign in with Google, then open Developer API.
- A server to call the API from — any language works. For JavaScript there's the TypeScript SDK, which runs on Node.js 18+, Deno, Bun and edge runtimes.
- The shopper's agreement: they must be an adult, and must agree to their photo being processed.
Next steps
QuickstartYour first try-on in five minutes, with the SDK, curl or Python.Next.jsA route handler and a drop-in button, in three steps.TypeScript SDKUploads, try-ons, waiting, retries and typed errors.Add try-on to a custom storeThe full shape of a storefront integration.EndpointsEvery field, header and response.Full examplesWorking Node.js, Python and Next.js stores.

