Factory
4 Factory routes on the FLAM API: What the house INTENDS, before a token moves; The one confirm — create the batch of draft looks; The house's standing.
Base URL https://api.flam.fashion. Send Authorization: Bearer flam_sk_… on every call; a handful of routes are session-only and say so. How keys and roles work.
POST /api/toolkit/factory/plan
What the house INTENDS, before a token moves
Groups the dropped pieces into candidate looks using the stamps the smart upload already wrote (a hand-made group beats a shared SKU; a piece with neither is its own look), itemises the whole cost and states the live balance beside it. modelReady says up front whether the preset's model still exists — the one thing the house cannot invent. Reads only.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
assetIds | string[] | yes | — |
quality | "1k" | "2k" | "4k" | no | — |
{
"assetIds": [
"string"
],
"quality": "1k"
}Responses
| Status | Meaning |
|---|---|
200 | The proposal |
400 | BAD_BODY / ASSETS_REQUIRED |
401 | No valid session |
404 | ASSET_NOT_FOUND |
200 returns:
{
"preset": {
"modelAssetId": "string",
"background": {
"kind": "preset",
"value": "string",
"assetId": "string"
},
"aesthetic": "string",
"variationKeys": [
"string"
],
"quality": "1k"
},
"looks": [
{}
],
"truncated": true,
"modelReady": true,
"cost": {
"perFrame": 0,
"framesPerLook": 0,
"frames": 0,
"total": 0,
"quality": "string"
},
"balance": 0
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/factory/plan" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"assetIds":["string"],"quality":"1k"}'POST /api/toolkit/factory/run
The one confirm — create the batch of draft looks
SPENDS NOTHING. It creates one DRAFT look per proposed look, stamped with a shared batch marker, and answers with their ids; the caller then walks those ids through the crown's own develop routes, which own every reserve. The body is the EDITED proposal — a dropped look is simply absent, and a look may override the preset's ground or variation set. One bad look rejects the whole confirm rather than leaving half a batch.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
looks | object[] | yes | — |
modelAssetId | string | no | — |
aesthetic | string | no | — |
quality | "1k" | "2k" | "4k" | no | — |
brandId | string | null | no | — |
{
"looks": [
{
"name": "string",
"itemAssetIds": [
{}
],
"background": {},
"variationKeys": [
"string"
]
}
],
"modelAssetId": "string",
"aesthetic": "string",
"quality": "1k",
"brandId": "string"
}Responses
| Status | Meaning |
|---|---|
201 | The created batch |
400 | BAD_BODY / LOOKS_REQUIRED / TOO_MANY_LOOKS / MODEL_REQUIRED / BAD_AESTHETIC / NAME_REQUIRED / ITEMS_REQUIRED / TOO_MANY_ITEMS / BAD_ITEM / KEYS_REQUIRED / TOO_MANY_FRAMES / UNKNOWN_VARIATION |
401 | No valid session |
404 | ASSET_NOT_FOUND |
201 returns:
{
"batchId": "string",
"quality": "string",
"looks": [
{
"id": "string",
"name": "string",
"variationKeys": [
"string"
]
}
]
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/factory/run" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"looks":[{"name":"string","itemAssetIds":[{}],"background":{},"variationKeys":["string"]}],"modelAssetId":"string","aesthetic":"string","quality":"1k","brandId":"string"}'GET /api/toolkit/presets
The house's standing preset
NEVER 404s. A director who has never opened brand settings still gets a working preset, so the factory is one drop away.
Responses
| Status | Meaning |
|---|---|
200 | The preset |
401 | No valid session |
200 returns:
{
"preset": {
"modelAssetId": "string",
"background": {
"kind": "preset",
"value": "string",
"assetId": "string"
},
"aesthetic": "string",
"variationKeys": [
"string"
],
"quality": "1k"
}
}Call it
curl -X GET "https://api.flam.fashion/api/toolkit/presets" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/toolkit/presets
Set the house's standing preset
Every field is validated against the COMPOSER's own vocabulary, so a stored preset can never carry a key the develop routes would reject later — a preset that fails at develop time is a trap.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
aesthetic | string | yes | — |
background | object | yes | — |
variationKeys | string[] | yes | — |
modelAssetId | string | null | no | — |
quality | "1k" | "2k" | "4k" | no | — |
{
"aesthetic": "string",
"background": {
"kind": "preset",
"value": "string",
"assetId": "string"
},
"variationKeys": [
"string"
],
"modelAssetId": "string",
"quality": "1k"
}Responses
| Status | Meaning |
|---|---|
200 | The stored preset |
400 | BAD_BODY / BAD_AESTHETIC / BAD_BACKGROUND / KEYS_REQUIRED / TOO_MANY_FRAMES |
401 | No valid session |
404 | ASSET_NOT_FOUND |
200 returns:
{
"preset": {
"modelAssetId": "string",
"background": {
"kind": "preset",
"value": "string",
"assetId": "string"
},
"aesthetic": "string",
"variationKeys": [
"string"
],
"quality": "1k"
}
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/presets" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"aesthetic":"string","background":{"kind":"preset","value":"string","assetId":"string"},"variationKeys":["string"],"modelAssetId":"string","quality":"1k"}'