Render a person wearing one or more trial garments
const url = 'https://example.com/v1/try-on';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"user_image":"uploads/01JUSER000000000000000000/person.jpg","user_category":"FEMALE","items":[{"trial_image":"uploads/01JITEM000000000000000000/shirt.jpg","trial_item_category":"top"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/try-on \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "user_image": "uploads/01JUSER000000000000000000/person.jpg", "user_category": "FEMALE", "items": [ { "trial_image": "uploads/01JITEM000000000000000000/shirt.jpg", "trial_item_category": "top" } ] }'Dispatch a virtual try-on: apply one or more trial garments to a person image. Pass the upload_key (from POST /v1/uploads) of the person photo as user_image, and one entry per garment in items (each with its own trial-image key + category). Returns 202 immediately with a job_id; poll GET /v1/jobs/{job_id}/events for live progress and GET /v1/jobs/{job_id} for the terminal render. Costs 10 credits, refunded automatically on any failure path.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”Try-on submission.
object
S3 object key of the person image to try the items on.
User gender. Matches studio.schema.common.UserCategory.
One or more trial items to apply to the user image.
One trial garment passed to /v1/try-on.
object
S3 object key of the trial garment image.
Garment category key (e.g. ‘top’, ‘shirt’, ‘jeans’). See studio.schema.common.TryItemCategory for the full list.
Rendering options for the try-on output. Mirrors studio.schema.tryon.RenderParams.
object
Output image-size tier. Mirrors studio.schema.tryon.RenderResolution.
Examples
One garment on a person image
{ "user_image": "uploads/01JUSER000000000000000000/person.jpg", "user_category": "FEMALE", "items": [ { "trial_image": "uploads/01JITEM000000000000000000/shirt.jpg", "trial_item_category": "top" } ]}Responses
Section titled “ Responses ”Accepted — job queued. Poll /v1/jobs/{job_id} for progress.
Returned synchronously from any POST /v1/{name} (202).
object
26-char ULID — correlates with the row in request_logs.
Studio’s job status at submit time. Almost always NOT_STARTED in this 202.
Credits deducted from the calling client. Refunded automatically on any failure path.
Example
{ "request_id": "01JREQREQREQREQREQREQREQ00", "job_id": "01JOBJOBJOBJOBJOBJOBJOBJOB0", "status": "NOT_STARTED", "credits_cost": 10}Insufficient credit balance — the request cost exceeds the client’s balance. No job created.
Example
{ "error": { "code": "INSUFFICIENT_BALANCE", "message": "Account balance is below the cost of this request.", "request_id": "01JREQREQREQREQREQREQREQ00" }}Request body failed validation (missing/invalid fields). No credits charged.
Example
{ "error": { "code": "VALIDATION_ERROR", "message": "Request body or parameters failed validation.", "request_id": "01JREQREQREQREQREQREQREQ00" }}Per-credential rate limit exceeded. Retry after a short backoff.
Example
{ "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded; try again shortly.", "request_id": "01JREQREQREQREQREQREQREQ00" }}