Skip to content

Quickstart

This guide walks you through making your first API call — from getting a key to generating a virtual try-on image.

Sign up at the Developer Portal and generate an API key. Your key will look like ss_a1b2c3d4e5f6....

Terminal window
curl https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/

You should get:

{"status": "ok", "service": "superstyle-api", "version": "1.0.0"}
Terminal window
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"}'
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']})")
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})`);
});
Terminal window
# First, base64 encode your selfie
SELFIE_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"
}
Terminal window
curl https://mcll3bnfubyazfg6wekv3xc6fi0dgpyk.lambda-url.us-east-1.on.aws/usage \
-H "X-API-Key: YOUR_API_KEY"