TailorLens API

From photo to pattern: a sketch, technical flats, a size-adjusted sewing pattern and colour palettes from one specification. No guarantee of fit. Machine-readable spec: /api/openapi.json.

Authenticate

curl -H "Authorization: Bearer $TAILORLENS_KEY" https://tailorlens.sensifai.com/api/v1/meta

Create keys on the dashboard under Settings. Only POST /api/v1/analyses is billed, and only once the report is delivered.

Analyse a garment

curl -X POST -H "Authorization: Bearer $TAILORLENS_KEY" \
  -F [email protected] -F [email protected] \
  -F roles=front,back \
  -F 'facts={"measurements_mm":{"waist":720,"hip":960},"units":"cm"}' \
  https://tailorlens.sensifai.com/api/v1/analyses
# 202 {"job_id":"...","analysis_id":"...","poll":"/api/v1/jobs/..."}
curl -H "Authorization: Bearer $TAILORLENS_KEY" https://tailorlens.sensifai.com/api/v1/jobs/JOB_ID
curl -H "Authorization: Bearer $TAILORLENS_KEY" https://tailorlens.sensifai.com/api/v1/analyses/JOB_ID

Send one to five JPEG or PNG photos with a role each: front, back, side, detail or flat. A photo that cannot be used is refused with 422 before anything is charged.

Edit and export (free)

curl -X PATCH -H "Authorization: Bearer $TAILORLENS_KEY" -H "Content-Type: application/json" \
  -d '{"facts":{"measurements_mm":{"bust":900,"waist":720,"hip":960}}}' \
  https://tailorlens.sensifai.com/api/v1/analyses/JOB_ID/spec
curl -OJ -H "Authorization: Bearer $TAILORLENS_KEY" \
  "https://tailorlens.sensifai.com/api/v1/analyses/JOB_ID/exports/pattern.pdf?paper=a4"
# 409 while a required measurement is still missing: errors[] lists the reasons

Check photos first (free)

curl -X POST -H "Authorization: Bearer $TAILORLENS_KEY" \
  -F [email protected] -F roles=front \
  https://tailorlens.sensifai.com/api/v1/preview