Try-On API
Two calls per generation. Async by default.
Base URL https://api.genfashion.app/tryon/v1. Every request carries x-api-key. Generation is asynchronous: POST /try-on returns immediately, and you poll or take a webhook.
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /images/upload | Upload a person photo, get a reusable imageId |
POST | /try-on | Run a generation. Returns generationId |
GET | /generations/:id | Poll status; resultImageUrl when COMPLETED |
GET | /products | List products |
DELETE | /products/:externalId | Delete a product |
GET | /account/credits | Remaining credit balance |
DELETE | /customers/:externalUserId | Right-to-erasure for one end user |
The products array
products takes exactly one item today; the array shape is reserved for multi-garment outfits. Each item works three ways.
| Shape | Body | Product lifetime |
|---|---|---|
| Reference | { "externalId": "shirt-42" } | unchanged |
| Inline upsert | { externalId, title, description, images } | 15 days from last use |
| One-shot | { title, description, images } — no id | 7 days from last use |
Every generation refreshes the timer, so an actively used product never expires.
The recommended integration is reference-first, upsert on miss: send the cheap reference form, and when you get PRODUCT_NOT_FOUND, retry with the full inline body. It is the whole integration in one pattern, and it self-heals when a TTL lapses.
The person image
person.image.source holds exactly one of:
| Field | When | Trade-off |
|---|---|---|
id | Recommended. From a prior upload | Reusable; the only path that controls cropping |
url | One-shot from a remote URL | Re-downloaded and re-cropped every call |
fileKey | Bytes in this multipart request | Always 4:5 cropped |
Output controls
| Field | Default | Notes |
|---|---|---|
output.watermark | true | No-op without a configured logo |
output.aiLabel | account default | The visible AI MODIFIED badge. Machine-readable provenance metadata is always written and is not configurable |
output.keepForDays | account default | 1, 3 or 7 |
externalUserId | — | Opaque, no PII. The attribution and erasure key |
Testing
Send a product whose title is mock and the generation runs the full pipeline but returns the person image unchanged — fast and deterministic. It still consumes a credit, which keeps the test path honest about cost.