POST/vton/generate

Generate Try-On

Trigger the virtual try-on rendering engine. This is an asynchronous model call wrapped in a synchronous API endpoint that returns the finished URL when done.

Authentication: Required (X-API-Key)
Content-Type: application/json

Request Parameters

FieldTypeRequiredDefaultDescription
model_namestringYesChoose: "fast", "medium", or "quality".
inputClothesImageUrlsList[string]YesList of 1 to 4 garment image URLs (obtained from /vton/upload or public URLs).
inputPersonImageUrlsList[string]No[]List of up to 4 reference model URLs.
promptstringNo""Optional instruction prompt. If blank, is auto-generated.
versionfloatNo1.0Model version map: 1.0 or 1.1.
productIdstringNonullOptional internal catalog SKU/ID (helps track product usage metrics).
externalUserIdstringNonullOptional end-consumer identifier of your client application.
metadataobjectNonullOptional key-value dictionary for storing custom properties.
Pro Tip
Prompt Auto-Generation: If you leave prompt empty, the backend engine dynamically builds a highly descriptive VTON prompt based on the layout and number of input images (e.g. "Replace the clothing in the first image with the garment from the 2nd image.").
curl -X POST "https://apisdk.snapmydesign.com/api/v1/vton/generate" \
  -H "X-API-Key: smd_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "medium",
    "inputClothesImageUrls": [
      "https://firebasestorage.googleapis.com/v0/b/xdesign-d72cd.appspot.com/o/vton_uploaded_image%2Ftshirt.png"
    ],
    "inputPersonImageUrls": [],
    "prompt": "Put the shirt on the model",
    "version": 1.0,
    "userId": "user_abc123"
  }'
Example Response200 OK
{
  "success": true,
  "statusCode": 200,
  "message": "success",
  "generationId": "50c76d05-4f40-424a-9ef8-11db9390234a",
  "outputImageUrls": [
    "https://firebasestorage.googleapis.com/.../vton_generated_image..."
  ],
  "inputClothesImageUrls": [
    "https://firebasestorage.googleapis.com/.../vton_uploaded_image..."
  ],
  "inputPersonImageUrls": [],
  "userId": "user_abc123",
  "creditCost": 0.5,
  "modelName": "medium",
  "version": 1.0,
  "prompt": "Replace the clothing in the first image with the garment from the 1th image.",
  "productId": "sku_9921_blue",
  "externalUserId": "consumer_myntra_77612",
  "metadata": {
    "campaign": "summer_sale_2026",
    "gender": "male"
  },
  "startTimestamp": 1780000000,
  "endTimestamp": 1780000005,
  "apiKeyLabel": "production_server_key"
}