OpenAPI Specification
Download the OpenAPI 3.1 spec of the virtual try-on API to import it into Postman or Insomnia, generate a client, or hand it to an LLM agent.
The whole public virtual try-on API (https://tryiton.now/api/v1) is described in one OpenAPI 3.1 file:
What the spec covers
The spec describes 14 operations:
| Area | Operations |
|---|---|
| Photo try-on | POST /tryon/fashion, POST /tryon/hairstyle, POST /tryon/tattoo |
| Jobs and account | GET /status/{id}, GET /credits, GET /health |
| Live, server | GET /live/config, POST /live/garments, POST /live/sessions, GET /live/sessions/{id}, POST /live/sessions/{id}/stop |
| Live, browser | POST /live/sessions/{id}/heartbeat, POST /live/sessions/{id}/garments/{garmentId}, POST /live/sessions/{id}/end |
Each operation comes with its request and response schemas, required fields, defaults, limits, enums, examples,
and the error.name values it can return. The storefront widget's embed routes and TryItOn's internal routes are
not part of the public API, so the spec leaves them out.
Authentication. Most operations take your API key as Authorization: Bearer YOUR_API_KEY. GET /health takes
no credential. The three live browser endpoints take the session's clientSecret instead, so the spec marks them as
needing no API key. See Live Try-On Browser Endpoints.
What you can do with it
- Postman or Insomnia. Import the URL above as a new collection. Set the collection's bearer token to your API key and every request is ready to send.
- Client generation. Point a generator such as OpenAPI Generator at the file to build a client in a language the official SDKs don't cover.
- LLM agents. Give the URL to an agent or a tool-calling framework. It describes every operation, parameter and error in a form a model can follow, so the agent can call the API without guessing.
SDKs or a generated client?
For Node.js, Python, Go, PHP and Ruby, use the official virtual try-on SDKs rather than a generated
client. They're written by hand on top of the same contract and add what a generator can't: waiting for a job's
result with polling and a timeout, one error type that carries error.name, and the live session calls shaped for
handing the start response to the browser. For the browser side of live try-on, use
tryiton-live.
Source of truth
The spec is kept next to the API's code and is the source of truth for the API's behavior. A test checks its operations against the server's routes on every run, and all five SDKs run a shared set of contract test cases kept alongside it. When the API changes, the spec, the SDKs and these docs change together.
Related
- Virtual Try-On SDKs: install and configure an official SDK.
- Authentication & API Keys: create a key and send it.
- Error Codes & Handling: every
error.namethe API returns.
Live: Browser Endpoints
Heartbeat, garment switch and end: the browser endpoints of the real-time virtual try-on API, authenticated by the session secret, for custom live clients.
Live Try-On Quickstart
Add real-time virtual try-on to your site: prepare garments and start live sessions on your server, then stream the shopper's webcam with tryiton-live.