# Virtual Try-On (Single)

For AI agents: this is the Markdown version of https://docs.fashiolabs.com/tools/virtual_model.html. The index of all Fashio API docs is at https://docs.fashiolabs.com/llms.txt, and the complete reference in one file is at https://docs.fashiolabs.com/llms-full.txt.

Put one garment photo on an AI fashion model — pick the model, pose and venue, or let Fashio choose a clean studio default.

`toolId: "virtual_model"` · 4 credits · model\_garment · ratio: global (default 1:1)

![Virtual try-on result — garment on an AI fashion model](https://fashiolabs.com/min/images/remote/virtual_2-e111022984d2.webp)

## What it does

One garment photo goes on one AI fashion model. The garment's cut, print, hardware and any logo are reproduced exactly — the model, pose and background are what change.

## Request body

| Field | Type |  | Description |
| --- | --- | --- | --- |
| `toolId` | string | required | Always `"virtual_model"`. |
| `images.fashion_model` | string | required | A catalog ID from [GET /v1/fashion-models](https://docs.fashiolabs.com/core-endpoints.md), or a direct image URL. |
| `images.garment_photo` | string | required | URL of the garment photo (from `POST /v1/uploads` or your own hosting). |
| `images.venue` | string | optional | A catalog ID from [GET /v1/venues](https://docs.fashiolabs.com/core-endpoints.md), or a direct image URL. Omit for a clean studio background. |
| `pose` | string | optional | A catalog ID from [GET /v1/poses](https://docs.fashiolabs.com/core-endpoints.md). Omit for a natural standing pose. |
| `ratio` | string | optional | One of `1:1`, `4:5`, `3:4`, `9:16`, `16:9`. Defaults to `1:1`. |

## Example request

**cURL**

```bash
curl -X POST https://api.fashiolabs.com/v1/generations \
  -H "Authorization: Bearer fio_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "toolId": "virtual_model",
    "images": {
      "fashion_model": "fm_south_asian_01",
      "garment_photo": "https://your-cdn.com/dress.jpg",
      "venue": "venue_studio_white"
    },
    "pose": "pose_standing_relaxed",
    "ratio": "4:5"
  }'
```

**Node.js**

```javascript
const res = await fetch("https://api.fashiolabs.com/v1/generations", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.FASHIO_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    toolId: "virtual_model",
    images: {
      fashion_model: "fm_south_asian_01",
      garment_photo: "https://your-cdn.com/dress.jpg",
      venue: "venue_studio_white",
    },
    pose: "pose_standing_relaxed",
    ratio: "4:5",
  }),
});
const { id } = await res.json();
```

**Python**

```python
import os, requests

res = requests.post(
    "https://api.fashiolabs.com/v1/generations",
    headers={"Authorization": f"Bearer {os.environ['FASHIO_API_KEY']}"},
    json={
        "toolId": "virtual_model",
        "images": {
            "fashion_model": "fm_south_asian_01",
            "garment_photo": "https://your-cdn.com/dress.jpg",
            "venue": "venue_studio_white",
        },
        "pose": "pose_standing_relaxed",
        "ratio": "4:5",
    },
)
job_id = res.json()["id"]
```

## Response

**202 Accepted**

```json
{ "success": true, "id": "8b1e...", "status": "processing" }
```

Poll `GET /v1/generations/:id` (see [Quickstart](https://docs.fashiolabs.com/quickstart.md)) until it completes:

**200 · completed**

```json
{
  "success": true,
  "id": "8b1e...",
  "status": "completed",
  "resultUrls": ["https://.../result.jpg"],
  "errorMessage": null
}
```

## Common errors

| Status | Meaning |
| --- | --- |
| 400 | `virtual_model: missing required image "fashion_model"` — required image field wasn't resolvable. |
| 402 | `Insufficient diamonds. Required 4, have <n>.` |
| 429 | Daily request cap reached for this key — see [Rate Limits](https://docs.fashiolabs.com/rate-limits.md). |

## Related tools

- [Virtual Try-On (Batch)](https://docs.fashiolabs.com/tools/outfit_photo.md) — same idea, multiple garments in one shot.
- [Pro Studio](https://docs.fashiolabs.com/tools/pro_studio.md) — adds shot-type and style-preset controls.
- [Model Swap](https://docs.fashiolabs.com/tools/model_swap.md) — change who's wearing an existing photo instead.

---

Source: https://docs.fashiolabs.com/tools/virtual_model.html · OpenAPI spec: https://docs.fashiolabs.com/openapi.yaml · Docs index: https://docs.fashiolabs.com/llms.txt
