Getting Started
Quickstart
From a product photo to a finished on-model image in four calls. This walkthrough uses
virtual_model (Virtual Try-On); the same shape applies to every tool — see each
tool's own page for its specific fields.
1. Upload your product photo
Send raw image bytes (JPEG/PNG/WebP, max 8 MB) — get back a URL usable in the next step. You can skip this if your image is already hosted at a public URL.
curl -X POST https://api.fashiolabs.com/v1/uploads \
-H "Authorization: Bearer fio_live_YOUR_KEY" \
-H "Content-Type: image/jpeg" \
--data-binary @dress.jpg
const bytes = await fs.readFile("dress.jpg");
const res = await fetch("https://api.fashiolabs.com/v1/uploads", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.FASHIO_API_KEY,
"Content-Type": "image/jpeg",
},
body: bytes,
});
const { url } = await res.json();
Response · 200
{
"success": true,
"id": "3f2a9e1c-...",
"url": "https://firebasestorage.googleapis.com/v0/b/.../api_uploads%2F...jpg?alt=media&token=..."
}2. Pick a model, pose, venue (optional)
Browse the catalogs to get IDs for fashion_model, pose and venue —
see Core Endpoints. Skip this and omit the fields for a clean
studio default.
3. Start the generation
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://firebasestorage.googleapis.com/.../dress.jpg"
},
"ratio": "4:5"
}'
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: url, // from step 1
},
ratio: "4:5",
}),
});
const { id } = await res.json();
Response · 202
{ "success": true, "id": "8b1e...", "status": "processing" }4. Poll for the result
Generation runs in the background. Poll every 2–3 seconds until status is
completed or failed.
curl https://api.fashiolabs.com/v1/generations/8b1e... \
-H "Authorization: Bearer fio_live_YOUR_KEY"
async function poll(id) {
for (;;) {
const res = await fetch(`https://api.fashiolabs.com/v1/generations/${id}`, {
headers: { Authorization: "Bearer " + process.env.FASHIO_API_KEY },
});
const job = await res.json();
if (job.status === "completed") return job.resultUrls;
if (job.status === "failed") throw new Error(job.errorMessage);
await new Promise((r) => setTimeout(r, 2000));
}
}
Response · 200 (completed)
{
"success": true,
"id": "8b1e...",
"status": "completed",
"resultUrls": ["https://.../result.jpg"],
"errorMessage": null
}i
A failed generation automatically refunds the diamonds it charged — you never pay for a job
that didn't finish.