Complete reference for StyleSwap's virtual try-on API
All API requests require authentication using your API key. Include it in the request header:
Authorization: Bearer sk_your_api_key
Get your API key from the Developer Portal
https://api.styleswap.com/v1
Generate a virtual try-on image for a product
POST /try-ons/create
Create a new virtual try-on
{
"userPhotoUrl": "https://...",
"garmentImageUrl": "https://...",
"garmentType": "shirt",
"size": "M"
}{
"id": "tryon_123abc",
"status": "processing",
"resultUrl": null,
"createdAt": "2026-02-11T10:30:00Z"
}Check the status of a virtual try-on request
GET /try-ons/{id}
Retrieve try-on status and result
{
"id": "tryon_123abc",
"status": "completed",
"resultUrl": "https://cdn.styleswap.com/results/...",
"createdAt": "2026-02-11T10:30:00Z",
"completedAt": "2026-02-11T10:31:45Z"
}StyleSwap uses a credit-based billing model. Each virtual try-on costs 1 credit.
Reduce Returns. Increase Conversions. Let customers try before they buy.
Contact [email protected] for custom pricing
Additional simulations billed at plan rate.
Seamless integration via widget, API, or social selling landing page.
Initiate a credit purchase for your account
POST /billing/initiatePurchase
{
"packageId": "pkg_100_credits",
"quantity": 1
}Note: All credits are valid for 30 days from purchase. Credits are non-refundable once purchased. Additional simulations billed at plan rate.
StyleSwap sends webhook events for important actions. Configure your webhook URL in the Developer Portal.
{
"event": "tryon.completed",
"timestamp": "2026-02-11T10:31:45Z",
"data": {
"id": "tryon_123abc",
"resultUrl": "https://cdn.styleswap.com/results/...",
"processingTime": 105
}
}The API returns standard HTTP status codes. Errors include a detailed error message:
400 Bad Request
Invalid request parameters
401 Unauthorized
Invalid or missing API key
429 Too Many Requests
Rate limit exceeded
500 Internal Server Error
Server error - please retry