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":{"type":"asset","asset_id":"01J7B7W8M3R4X5Y6Z7A8B9C0D1"},"user_category":"FEMALE","items":[{"trial_image":{"type":"asset","asset_id":"01J7B7W8M3R4X5Y6Z7A8B9C0D2"},"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": { "type": "asset", "asset_id": "01J7B7W8M3R4X5Y6Z7A8B9C0D1" }, "user_category": "FEMALE", "items": [ { "trial_image": { "type": "asset", "asset_id": "01J7B7W8M3R4X5Y6Z7A8B9C0D2" }, "trial_item_category": "top" } ] }'Dispatch a virtual try-on: apply one or more trial garments to a person image. Pass the asset_id from POST /v1/uploads as the person and garment references. A narrowly-scoped Wardrobe credential may use the explicit wardrobe_legacy_key reference during migration. 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 Bodyrequired
Section titled “Request Bodyrequired”Try-on submission.
object
A durable, owner-resolved asset reference for canonical VTON.
object
Canonical asset ULID returned by POST /v1/uploads.
A narrowly-authorized Wardrobe key awaiting trusted asset adoption.
object
Existing Wardrobe image key. Requires wardrobe:legacy-assets.
User gender category.
One to four trial items to apply to the user image.
One garment passed to canonical /v1/try-on.
Name the garment either by image reference (trial_image) or by one of your
own products (product_public_id, from GET /v1/products) — exactly one.
Studio resolves a product to its product shot, and inherits the product’s
category and title unless you send your own (TRI-44).
object
A durable, owner-resolved asset reference for canonical VTON.
object
Canonical asset ULID returned by POST /v1/uploads.
A narrowly-authorized Wardrobe key awaiting trusted asset adoption.
object
Existing Wardrobe image key. Requires wardrobe:legacy-assets.
Rendering options for the try-on output. Mirrors contracts.tryon.RenderParams.
object
Output image-size tier, forwarded to the image model as image_size.
Examples
One garment on a person image
{ "user_image": { "type": "asset", "asset_id": "01J7B7W8M3R4X5Y6Z7A8B9C0D1" }, "user_category": "FEMALE", "items": [ { "trial_image": { "type": "asset", "asset_id": "01J7B7W8M3R4X5Y6Z7A8B9C0D2" }, "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 credit_operations.
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" }}