> ## Documentation Index
> Fetch the complete documentation index at: https://docs.genlook.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Add AI virtual try-on to any app or store in two API calls.

Send a customer photo and a product, get back a photo of the customer wearing it. No catalog sync: products are created and cached on the fly by the try-on call.

## Basics

| | |
| - | - |
| Base URL | `https://api.genlook.app/tryon/v1` |
| Auth | `x-api-key: gk_...` header on every request. Create keys on [platform.genlook.app](https://platform.genlook.app): one per app or environment, each with its own name, optional monthly credit limit and usage. |
| Price | 1 credit per try-on, 2 for a [multi-product outfit](https://docs.genlook.app/docs/tryon-api/multi-product.md) of 2 to 4 products, 1 more for a [2K result](https://docs.genlook.app/docs/tryon-api/endpoints/create-try-on.md#body-output-resolution), refunded on failure. $0.04 pay as you go, from $0.015 on a [plan](https://genlook.app/developers#pricing). Pack credits never expire. A plan's monthly allowance resets each month, and past it try-ons keep working at the plan rate. New accounts get 10 free credits. Test for free with [`mock: true`](https://docs.genlook.app/docs/tryon-api/endpoints/create-try-on#body-mock). |
| Speed | About 10 seconds per result. |
| Errors | `{ code, message, status }`. Switch on `code`. See [Errors](https://docs.genlook.app/docs/tryon-api/errors.md). |
| SDK | [`@genlook/api`](https://docs.genlook.app/docs/tryon-api/sdk) for Node 20+, Deno, Bun and edge runtimes. Server-side only. |

## How it works

```mermaid theme={null}
sequenceDiagram
    participant You
    participant API as Genlook API
    You->>API: POST /images/upload (customer photo)
    API-->>You: imageId
    You->>API: POST /try-on (product + imageId)
    API-->>You: generationId
    loop every second
        You->>API: GET /generations/:id
    end
    API-->>You: COMPLETED + resultImageUrl
```

1. **[Upload the customer photo](https://docs.genlook.app/docs/tryon-api/endpoints/upload-image.md)** once. Reuse the `imageId` for every try-on.
2. **[Create the try-on](https://docs.genlook.app/docs/tryon-api/endpoints/create-try-on.md)** with the product inline (`externalId`, title, description, images). The product is created or updated in the same call. Next time, send only the `externalId`.
3. **[Poll the generation](https://docs.genlook.app/docs/tryon-api/endpoints/generation-status.md)** until `COMPLETED`, or call `client.generations.waitFor()` in the SDK.

> [!TIP]
>
> Send the full product title and description. They tell the AI what the garment is and how it fits, which gives faster
> and more accurate results.

## Products

`products` takes 1 to 4 items. Send two or more clothing items to try a whole look at once: see [Multiple products](https://docs.genlook.app/docs/tryon-api/multi-product.md). Each item takes one of three shapes:

| Shape | Body | Lifetime |
| - | - | - |
| Inline | `{ externalId, title, description, images }` | 30 days after last use |
| Reference | `{ externalId }` | Same product, no payload |
| One-shot | `{ title, description, images }` (no `externalId`) | 7 days after last use |

> [!TIP]
>
> **Send a product once, then reuse its ID.** The first try-on of a product analyzes it, which adds a few seconds. After
> that, send only `{ externalId }`: the analysis is reused, so results come back faster.

Every try-on resets the lifetime, so products in use never expire. If a reference returns `PRODUCT_NOT_FOUND`, resend it inline. [`POST /products`](https://docs.genlook.app/docs/tryon-api/endpoints/create-product) is optional: use it only for products that should never expire or should appear in `GET /products`.

## Limits

* `429 RATE_LIMITED` when you send too many requests. Back off and retry. Normal traffic, polling included, stays well below the limit.
* `429 RATE_LIMITED` when an account has more than 20 try-ons running at once. Wait for some to finish, or send bulk work through [batches](https://docs.genlook.app/docs/tryon-api/batches.md).
* `402 INSUFFICIENT_CREDITS` when the balance is empty. Top up in the dashboard.
* Images: JPEG, PNG, WebP or HEIC, 10 MB max.

> [!TIP]
>
> Building a new product? The [startup program](https://docs.genlook.app/docs/tryon-api/startup-program.md) gives free credits to new integrations.

## Next steps

> [card] [Quickstart](https://docs.genlook.app/docs/tryon-api/quickstart.md)
>
> First try-on in 5 minutes

> [card] [TypeScript SDK](https://docs.genlook.app/docs/tryon-api/sdk.md)
>
> Typed client with a built-in poller

> [card] [Example app (Next.js)](https://github.com/GenlookLabs/virtual-try-on-api-example)
>
> Clone a working integration

> [card] [MCP server](https://docs.genlook.app/docs/tryon-api/mcp.md)
>
> Try-on from Claude, ChatGPT or Cursor


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.