fashio-client
v0.1.0
Published
Official JavaScript/TypeScript SDK for the Fashio API — generate on-model fashion photos and video from your own code.
Maintainers
Readme
fashio-client
Official JavaScript/TypeScript SDK for the Fashio API — generate on-model e-commerce fashion photos and video from your own code.
Fashio turns a garment or product photo into publish-ready photography and video with AI: virtual try-on, catalog packs, background removal, upscaling, reframing, and more — the same pipeline behind the Fashio app and dashboard, exposed as a public v1 REST API. This package is a thin, typed wrapper around that API — no local business logic, one method per endpoint.
Prefer to let an AI agent call it directly? See fashio-mcp.
Prefer the command line? See fashio-cli.
Install
npm install fashio-clientUsage
import { Fashio } from "fashio-client";
const fashio = new Fashio(process.env.FASHIO_API_KEY!);
// Start a virtual try-on generation
const job = await fashio.createGeneration({
toolId: "virtual_model",
images: {
fashion_model: "fm_south_asian_01",
garment_photo: "https://your-cdn.com/dress.jpg",
},
});
// Poll until it's done
let result = job;
while (result.status === "processing") {
await new Promise((r) => setTimeout(r, 2000));
result = await fashio.getGeneration(job.id);
}
console.log(result.resultUrls);Get a free key at fashiolabs.com → Profile → API Keys.
API
| Method | Endpoint |
|---|---|
| listModels() | GET /v1/models |
| listFashionModels({ gender?, limit? }) | GET /v1/fashion-models |
| listVenues({ limit? }) | GET /v1/venues |
| listPoses({ type?, limit? }) | GET /v1/poses |
| uploadImage(bytes, contentType) | POST /v1/uploads |
| createGeneration(body) | POST /v1/generations |
| getGeneration(id) | GET /v1/generations/:id |
| getAccount() | GET /v1/account |
| createTemplateSet(body) | POST /v1/template-sets |
| listTemplateSets() | GET /v1/template-sets |
| deleteTemplateSet(id) | DELETE /v1/template-sets/:id |
| listReadyTemplateSets(params) | GET /v1/ready-template-sets |
| getReadyTemplateSet(id) | GET /v1/ready-template-sets/:id |
| createCatalogJob(body) | POST /v1/catalog-jobs |
Full request/response shapes, per-tool required fields, and error codes: docs.fashiolabs.com.
Errors
Non-2xx responses throw FashioApiError (.status, .message):
import { Fashio, FashioApiError } from "fashio-client";
try {
await fashio.createGeneration({ toolId: "virtual_model" });
} catch (e) {
if (e instanceof FashioApiError && e.status === 402) {
console.log("Out of credits:", e.message);
}
}Links
- fashiolabs.com — product
- docs.fashiolabs.com — full API reference
- fashiolabs.com/pricing — plans & credit packs
License
MIT — see LICENSE.
