API Reference

Virtual Try-On API

Integrate AI-powered virtual try-on functionality into your e-commerce platform using StyleSense’s secure and scalable API.

Base URL https://localhost:7241

Authentication

All requests must include your API key in the request header. Requests without a valid key will be rejected.

X-API-KEY Required Header

Generate Try-On Image

POST /api/v1/virtual-try-on/generate

Request Parameters

Key Type Description
PersonImage File High-resolution image of the human model.
ProductImage File Clean image of the clothing item.

Response Status Codes

Status Message Description
200 Success Try-on image generated successfully.
401 Unauthorized Invalid or missing API key.
403 Forbidden License inactive or expired.
429 Quota Exceeded Monthly limit reached.
400 Bad Request Invalid image or AI detection failed.
500 Server Error Unexpected server failure.

JavaScript Example

const fd = new FormData();
fd.append('PersonImage', personFile);
fd.append('ProductImage', productFile);

fetch('/api/v1/virtual-try-on/generate', {
  method: 'POST',
  headers: { 'X-API-KEY': 'your_key_here' },
  body: fd
});