Live Try-On Sessions API
Start, list, inspect and stop real-time virtual try-on sessions from your server, and how the backup stream keeps a shopper connected.
A session is one shopper's live stream. Your server starts it with the API key and sends the whole start response
to the browser, where tryiton-live connects. Your server can also list, inspect and stop sessions. What a session
costs is on Live Try-On Billing.
Before you start one
- Open the camera first. The session holds a credit from the moment it starts, and a permission prompt can take a while.
- Send the whole response to the browser, unchanged, and pass it to
connectLiveTryOn. Don't pick fields out:tryiton-livereadsclientSecret,connectionandgarment. The media token in it can only start a connection within 60 seconds. - Send
end_user_idfor signed-in shoppers. Each shopper then gets one stream: a reload or a second tab ends the previous session withendReason: "superseded", charged like any other end. Use an opaque id, not an email. - Send
allowed_originon the web. It locks the media token to pages on your site. Leave it out for native apps. - Send
garment_idwhen you know the first garment. Its stream input comes back in the response, so the first frame doesn't wait on another call. Without it, the browser names a garment when it connects.
The order of the start checks. The first one that fails is the error you get:
- Parameters:
400, or404for an unknowngarment_id. - Live try-on switched off:
503 LiveTryonUnavailable. - Account disabled:
403 Forbidden. - At capacity, for accounts that haven't bought credits or a plan:
503 LiveTryonUnavailable. - Already
maxConcurrentSessionsstreams, not counting the shopper's own session that this start replaces:429 LiveTryonBusy. - Fewer than
minCreditsusable credits, or the first credit can't be held:429 OutOfCredits. - With
end_user_id, the shopper's previous session is ended. A start refused above leaves it running. - Two racing starts for the same
end_user_id:409 LiveSessionActive. Retry once. - Starts racing past the stream cap:
429 LiveTryonBusy. The hold is returned. - The media token or first garment couldn't be loaded:
503 LiveTryonUnavailable. The hold is returned.
Live starts never return ConcurrencyLimitExceeded: running photo try-ons don't block them.
bearerAuthAuthorizationBearer <token>Your API key from https://tryiton.now/app/developer, sent as Authorization: Bearer YOUR_API_KEY. Keep it on
your server. A missing, malformed or unknown key is rejected with 403 Forbidden.
application/json- body
garment_id?|A prepared garment to start with. Its stream input comes back in the response, so the first frame doesn't wait on another call. Without it, the device names a garment when it connects.
max_seconds?|Cap for this session, from 10 to maxSeconds in GET /live/config (180 by default). Defaults to maxSeconds.
10 <= value <= 180end_user_id?|Your id for the end user: 1-100 letters, digits and _ . - @ :. One stream per end user: starting again
ends their previous session.
^[\w.@:-]{1,100}$allowed_origin?|The browser origin the media token is locked to, e.g. https://shop.example.com (scheme matched
case-insensitively, no path). Recommended for web integrations; leave it out for native apps.
^https?://[^/\s]+$providers?array<>|The streams the device's client can play; must include decart. Left out, the session starts on the
primary stream and has the backup during connect. [decart, vidu] (tryiton-live 0.4+) may also start
on the backup while the primary is down. [decart]: primary only, no backup.
1 <= itemsSession started. Hand this body to the device.
application/json- response
ok*booleansession*clientSecret*stringSession-scoped secret for the device's calls. Never log or store it.
^[a-f0-9]{48}$connection*How the device reaches the media network. tryiton-live reads it; treat it as opaque.
secondsPerCredit*integerTick length for this session, fixed at start.
maxSeconds*integerThis session's cap.
secondsLeft*integerSeconds this session can stream now, the lower of the credit balance and the session cap.
0 <= valuegarment*|The first garment with its stream input when garment_id was given, else null.
curl -X POST 'https://tryiton.now/api/v1/live/sessions' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "garment_id": "6b0827eba2f220ae7dd7c7fb", "end_user_id": "shopper-42", "allowed_origin": "https://shop.example.com", "providers": [ "decart", "vidu" ]}'{ "ok": true, "session": { "id": "6b0828e5ed117d43a6d10ad1", "status": "active", "endReason": null, "seconds": 0, "creditsCharged": 0, "endUserId": "shopper-42", "apiKeyId": "6b0827eba2f220ae7dd7c7aa", "refunded": false, "creditsRefunded": 0, "createdAt": "2026-11-26T12:21:57.402Z", "endedAt": null }, "clientSecret": "3f9c2a7b1e4d6f80a2c5e7b9d1f3a5c7e9b2d4f6a8c0e1b3", "connection": { "provider": "decart", "model": "lucy-vton-latest", "token": "ek_live_8f2b9c4d1a7e", "backup": "vidu" }, "secondsPerCredit": 3, "maxSeconds": 180, "secondsLeft": 117, "garment": { "id": "6b0827eba2f220ae7dd7c7fb", "category": "clothing", "subcategory": "tops", "description": "a navy short-sleeve pique polo shirt", "prompt": "Substitute the current top with a navy short-sleeve pique polo shirt shown in the reference image, matching its color, material, and fit.", "enhancePrompt": true, "items": null, "createdAt": "2026-11-26T12:20:59.512Z", "input": { "prompt": "Substitute the current top with a navy short-sleeve pique polo shirt shown in the reference image, matching its color, material, and fit.", "enhancePrompt": true, "referenceImage": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBD" } }}Backup stream
Sessions run on the primary stream. A backup stream steps in two ways:
- During connect. When the primary stream fails for this shopper before the first frame, and the start response
has a
connection.backup,tryiton-live0.4 or later moves the same session to the backup with failover. Same session, same id. Your server does nothing. This is on by default. - At start. While the primary stream is down, a start can go straight to the backup. This needs
providers: ["decart", "vidu"](your browser client istryiton-live0.4 or later) and agarment_id.
Send providers: ["decart"] to turn the backup off. You then get no failover, and a 503 while the primary is
down. Billing is the same on both streams: a session that fails over is billed from its first backup frame, and the
failed attempt is free. If your page sets a Content Security Policy, see
the quickstart.
Status and usage of one of your live sessions.
bearerAuthAuthorizationBearer <token>Your API key from https://tryiton.now/app/developer, sent as Authorization: Bearer YOUR_API_KEY. Keep it on
your server. A missing, malformed or unknown key is rejected with 403 Forbidden.
id*stringA live session id from POST /live/sessions. Anything other than 24 hex characters is a 400.
^[a-fA-F0-9]{24}$The session.
application/json- response
ok*booleansession*curl -X GET 'https://tryiton.now/api/v1/live/sessions/6b0828e5ed117d43a6d10ad1' \ -H 'Authorization: Bearer YOUR_API_KEY'{ "ok": true, "session": { "id": "6b0828e5ed117d43a6d10ad1", "status": "ended", "endReason": "user", "seconds": 9, "creditsCharged": 5, "endUserId": "shopper-42", "apiKeyId": "6b0827eba2f220ae7dd7c7aa", "refunded": false, "creditsRefunded": 0, "createdAt": "2026-11-26T12:21:57.402Z", "endedAt": "2026-11-26T12:22:12.118Z" }}Your account's live sessions started through the API, newest first, with the same fields as Get a session. Use it for usage reports and to reconcile billing: creditsCharged is what a session was charged,
refunded and creditsRefunded show what was given back.
Pages hold up to limit sessions. When nextCursor is not null, pass it as cursor to get the next
(older) page. Filters combine with AND.
bearerAuthAuthorizationBearer <token>Your API key from https://tryiton.now/app/developer, sent as Authorization: Bearer YOUR_API_KEY. Keep it on
your server. A missing, malformed or unknown key is rejected with 403 Forbidden.
limit?integerSessions per page, from 1 to 100.
1 <= value <= 10020cursor?stringThe nextCursor of the previous page.
^[a-fA-F0-9]{24}$status?stringOnly sessions with this status.
"active""ended"end_reason?stringOnly sessions that ended for this reason.
"user""idle""hidden""error""unload""out_of_credits""time_limit""stale""superseded""budget"api_key_id?stringOnly sessions started with this API key (its id, as in a session's apiKeyId).
^[a-fA-F0-9]{24}$refunded?booleantrue: only sessions that were refunded (refunded: true). false is accepted and doesn't filter.
One page of sessions, newest first.
application/json- response
ok*booleansessions*array<>Newest first.
nextCursor*|Pass as cursor for the next (older) page; null on the last page.
curl -X GET 'https://tryiton.now/api/v1/live/sessions?cursor=6b0828e5ed117d43a6d10ad1' \ -H 'Authorization: Bearer YOUR_API_KEY'{ "ok": true, "sessions": [ { "id": "6b0828e5ed117d43a6d10ad1", "status": "ended", "endReason": "user", "seconds": 9, "creditsCharged": 5, "endUserId": "shopper-42", "apiKeyId": "6b0827eba2f220ae7dd7c7aa", "refunded": false, "creditsRefunded": 0, "createdAt": "2026-11-26T12:21:57.402Z", "endedAt": "2026-11-26T12:22:12.118Z" }, { "id": "6b0828a1ed117d43a6d10ac4", "status": "ended", "endReason": "error", "seconds": 0, "creditsCharged": 0, "endUserId": "shopper-17", "apiKeyId": "6b0827eba2f220ae7dd7c7aa", "refunded": true, "creditsRefunded": 0, "createdAt": "2026-11-26T12:20:51.880Z", "endedAt": "2026-11-26T12:21:03.004Z" } ], "nextCursor": "6b0828a1ed117d43a6d10ac4"}The dashboard shows the same list under Developer API → Requests → Live. Only sessions started through the API
are listed. Use end_reason=error to find streams that failed, and refunded=true for the ones given back.
Ends a session from your server, for example when the end user leaves the page. Idempotent: stopping an
ended session returns it unchanged. Ends with endReason: "user". No request body is needed. The held
credit is charged, plus any time the server's clock says is still owed (see Start a session).
bearerAuthAuthorizationBearer <token>Your API key from https://tryiton.now/app/developer, sent as Authorization: Bearer YOUR_API_KEY. Keep it on
your server. A missing, malformed or unknown key is rejected with 403 Forbidden.
id*stringA live session id from POST /live/sessions. Anything other than 24 hex characters is a 400.
^[a-fA-F0-9]{24}$The session.
application/json- response
ok*booleansession*curl -X POST 'https://tryiton.now/api/v1/live/sessions/6b0828e5ed117d43a6d10ad1/stop' \ -H 'Authorization: Bearer YOUR_API_KEY'{ "ok": true, "session": { "id": "6b0828e5ed117d43a6d10ad1", "status": "ended", "endReason": "user", "seconds": 9, "creditsCharged": 5, "endUserId": "shopper-42", "apiKeyId": "6b0827eba2f220ae7dd7c7aa", "refunded": false, "creditsRefunded": 0, "createdAt": "2026-11-26T12:21:57.402Z", "endedAt": "2026-11-26T12:22:12.118Z" }}Stop a session as soon as you know the shopper has left. A browser that vanishes without ending keeps the session
open until it goes stale, and the server's clock bills that time.
Garments & Outfits
Prepare garments and outfits for real-time virtual try-on: product photo in, a reusable garment id out. Free, cached, with custom stream instructions.
Browser Endpoints
Heartbeat, garment switch, failover and end: the browser endpoints of the real-time virtual try-on API, authenticated by the session secret.