Get started
Quickstart
Your first try-on in five minutes: get a key, test free, generate.
Your first try-on in five minutes.
1. Get an API key
- Sign up free. Every account starts with 10 free try-ons.
- Open Dashboard > API Keys and create a key. It starts with
tk_dev_v1_and is shown once, so copy it now. - Store it as an environment variable on your server:
bash
export TRYONCLOUD_API_KEY="tk_dev_v1_your_key_here"2. Test for free with mock mode
Add ?mock=true. The request is authenticated and both images are validated exactly like a real call, but nothing is generated and nothing is charged. The person image comes back unchanged.
bash
curl -X POST "https://www.tryoncloud.com/api/v1/generate?mock=true" \
-H "X-API-KEY: $TRYONCLOUD_API_KEY" \
-F "garment_image=@shirt.jpg" \
-F "person_image=@person.jpg" \
-o mock.png -D -Look for X-Mock: 1 in the response headers. Use mock mode while you build.
3. Generate a real try-on
Remove ?mock=true:
bash
curl -X POST "https://www.tryoncloud.com/api/v1/generate" \
-H "X-API-KEY: $TRYONCLOUD_API_KEY" \
-F "garment_image=@shirt.jpg" \
-F "person_image=@person.jpg" \
-o result.pngresult.png is the shopper wearing the garment. A typical result takes about 20 seconds, so give your HTTP client a timeout of at least 120 seconds.
4. Check what you have left
bash
curl https://www.tryoncloud.com/api/v1/credits -H "X-API-KEY: $TRYONCLOUD_API_KEY"Best photos for best results
- Person: one person, full body, facing the camera, good light, plain background if possible.
- Garment: a clear front-facing product photo, on a model or flat on a plain background.
- Draped garments (sarees, dhotis) work best when the product photo shows the garment draped on a model.
Next steps
- Full examples in Node.js, Next.js, Python and PHP
- Errors and when to retry
- Async jobs, batches and webhooks for long jobs and catalogue work
- Create one key per app or environment, with an optional monthly credit limit, on API Keys
- Buy credits when you are ready to go live