---
title: "AI size recommendation"
method: POST
path: "/v1/size-recommendation"
tags: ["Virtual Try-On"]
---

# AI size recommendation

`POST /v1/size-recommendation`

## Request

- Base URL: `https://api.crayonz.ai`
- URL: `https://api.crayonz.ai/v1/size-recommendation`
- Auth: API key in header `X-API-Key`

Recommend a product size given the product image and a size chart.

## Request body

- object
  - `image` string, required: Product image URL, or a photo of the shopper when imageType is "person"
  - `sizeChart` string, required: The size chart as plain text (max 10,000 chars)
  - `imageType` 'product' | 'person': "person" recommends for the shopper in the photo; default "product" recommends for an average adult
  - `availableSizes` string[]: Allowed size labels; the answer is validated against them

## Response `200`

Success

- object
  - `recommendedSize` string: Exact label from the size chart (or from availableSizes when given)
  - `reasoning` string
  - `confidence` number: From 0 to 1; omitted when the model did not report one

## Other responses

- `401`: Unauthorized — invalid or missing API key
- `402`: Insufficient credits
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/crayonz/apis/crayonz-api.md) · [All operations](https://skmtc.dev/crayonz/apis/crayonz-api/llms.txt) · [OpenAPI document](https://skmtc.dev/crayonz/apis/crayonz-api/revisions/1114c84167b2?raw)
