Quickstart

Updated 7 November 2026

By the end of this page you will have sent a shopper photo and a garment to the API, and fetched the finished try-on image.

You need a GenFashion account. New accounts start with free credits, enough for your first try-ons. If you would rather not write code, try the whole flow in the Playground.

1. Get a secret key#

Sign in to GenFashion, open Settings > API keys, and copy a secret key. It starts with sb_secret_. Keep it on your server and never put it in a web page.

2. Add a product to your catalogue#

A try-on needs a product that already exists in your catalogue, so add one in the console or through a store sync. Give it an external ID, such as shirt-42. A garment the API has not seen is refused with PRODUCT_NOT_FOUND.

3. Start the try-on#

Send the shopper photo as a url or as a base64 dataUrl, not both, and name the product by its external ID:

bash
curl -X POST "https://genfashion.buildframe.tech/api/tryon/v1/try-on" \
  -H "x-api-key: sb_secret_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "person": { "url": "https://shop.example.com/shopper.jpg" },
    "products": [{ "externalId": "shirt-42" }]
  }'

The response is 202 Accepted, which means the photo passed screening and the try-on has started:

json
{ "generationId": "gen_3f9a1c2b7d4e8a10", "status": "PROCESSING", "pollAfterMs": 5000 }

A 4xx response means the request was refused. No credit is used, and there is nothing to poll for.

4. Fetch the result#

Ask for the generation every 5 seconds, using the generationId from the last step:

bash
curl "https://genfashion.buildframe.tech/api/tryon/v1/generations/gen_3f9a1c2b7d4e8a10" \
  -H "x-api-key: sb_secret_your_key"

Keep asking until status is COMPLETED or FAILED. A try-on usually takes 45 to 60 seconds. When it completes, the response has a resultImageUrl, which is a signed link valid for 15 minutes. Download the image if you need it for longer.

Next steps#

New to GenFashion? See the product overview or start with free credits.