Quickstart
This guide walks you through making your first API call — from getting a key to generating a virtual try-on image.
1. Get an API key
Section titled “1. Get an API key”Sign up at the Developer Portal and generate an API key. Your key will look like ss_a1b2c3d4e5f6....
2. Test the connection
Section titled “2. Test the connection”curl https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/You should get:
{"status": "ok", "service": "superstyle-api", "version": "1.0.0"}3. Identify clothing in an image
Section titled “3. Identify clothing in an image”curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/identify_clothing \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"image_url": "https://example.com/outfit.jpg"}'Python
Section titled “Python”import requests
response = requests.post( "https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/identify_clothing", headers={"X-API-Key": "YOUR_API_KEY"}, json={"image_url": "https://example.com/outfit.jpg"})
items = response.json()["items"]for item in items: print(f"{item['item']}: {item['description']} ({item['color']})")TypeScript
Section titled “TypeScript”const response = await fetch("https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/identify_clothing", { method: "POST", headers: { "X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ image_url: "https://example.com/outfit.jpg", }),});
const { items } = await response.json();items.forEach((item: any) => { console.log(`${item.item}: ${item.description} (${item.color})`);});4. Generate a virtual try-on
Section titled “4. Generate a virtual try-on”# First, base64 encode your selfieSELFIE_BASE64=$(base64 -i selfie.jpg)
curl -X POST https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/generate_image \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d "{ \"selfie_base64\": \"$SELFIE_BASE64\", \"clothing_description\": \"Black leather jacket with white t-shirt\", \"mode\": \"studio\" }"The response includes a base64-encoded image:
{ "image_base64": "/9j/4AAQSkZJRg...", "mime_type": "image/jpeg"}5. Check your usage
Section titled “5. Check your usage”curl https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/usage \ -H "X-API-Key: YOUR_API_KEY"Next steps
Section titled “Next steps”- API Reference — Full endpoint documentation
- Python SDK — Idiomatic Python client
- TypeScript SDK — Type-safe TypeScript client
- Embeddable Widget — Add try-on to any website