Pipelines
9 Pipelines routes on the FLAM API: Saved plans — a line with no items bound; Save a plan as a preset; Delete a saved plan.
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.
GET /api/toolkit/pipelines/presets
Saved plans — a line with no items bound
Responses
| Status | Meaning |
|---|---|
200 | The presets, newest first (100) |
401 | No valid session |
200 returns:
{
"presets": [
{
"id": "string",
"name": "string",
"nodes": [
{}
],
"sinkFolderId": "string",
"updatedAt": "2026-07-27T09:00:00.000Z"
}
]
}Call it
curl -X GET "https://api.flam.fashion/api/toolkit/pipelines/presets" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/toolkit/pipelines/presets
Save a plan as a preset
The body may be { plan } or the plan object itself.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
plan | object | no | — |
{
"plan": {}
}Responses
| Status | Meaning |
|---|---|
201 | The saved preset |
400 | BAD_BODY / BAD_PLAN |
401 | No valid session |
201 returns:
{
"preset": {
"id": "string",
"name": "string",
"nodes": [
{}
],
"sinkFolderId": "string",
"updatedAt": "2026-07-27T09:00:00.000Z"
}
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/pipelines/presets" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":{}}'DELETE /api/toolkit/pipelines/presets/{id}
Delete a saved plan
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | Deleted |
401 | No valid session |
404 | NOT_FOUND |
200 returns:
{
"id": "string",
"deleted": true
}Call it
curl -X DELETE "https://api.flam.fashion/api/toolkit/pipelines/presets/{id}" \
-H "Authorization: Bearer $FLAM_API_KEY"PATCH /api/toolkit/pipelines/presets/{id}
Replace a saved plan
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
plan | object | no | — |
{
"plan": {}
}Responses
| Status | Meaning |
|---|---|
200 | The updated preset |
400 | BAD_BODY / BAD_PLAN |
401 | No valid session |
404 | NOT_FOUND |
200 returns:
{
"preset": {
"id": "string",
"name": "string",
"nodes": [
{}
],
"sinkFolderId": "string",
"updatedAt": "2026-07-27T09:00:00.000Z"
}
}Call it
curl -X PATCH "https://api.flam.fashion/api/toolkit/pipelines/presets/{id}" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":{}}'POST /api/toolkit/pipelines/preview
The number before the click
Compiles the plan against the chosen items and prices every frame, then states the live spendable balance beside it. Reads only — nothing is reserved, nothing is queued.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
plan | object | yes | A pipeline plan { id?, name, nodes } |
items | object[] | yes | — |
{
"plan": {},
"items": [
{}
]
}Responses
| Status | Meaning |
|---|---|
200 | The compiled line + affordability |
400 | BAD_BODY / BAD_PLAN / BAD_ITEMS |
401 | No valid session |
404 | ASSET_NOT_FOUND |
422 | LINE_TOO_WIDE { frames, max } |
200 returns:
{
"compiled": {},
"spendable": 0,
"affordable": true
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/pipelines/preview" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":{},"items":[{}]}'GET /api/toolkit/pipelines/runs
The house's pipeline runs, newest first
Responses
| Status | Meaning |
|---|---|
200 | The runs |
401 | No valid session |
200 returns:
{
"runs": [
{
"id": "string",
"name": "string",
"developId": "string",
"status": "developing",
"framesPlanned": 0,
"framesSkipped": 0,
"tokensPlanned": 0,
"tokensSpent": 0,
"steps": {
"done": 0,
"failed": 0,
"cancelled": 0,
"active": 0,
"total": 0
},
"line": "string",
"createdAt": "2026-07-27T09:00:00.000Z"
}
]
}Call it
curl -X GET "https://api.flam.fashion/api/toolkit/pipelines/runs" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/toolkit/pipelines/runs
Start the line
Drives either an inline plan or a saved planId. Reserve BEFORE the job row exists, one hold per step — money first, always. If a concurrent run takes the tokens mid-fan-out, everything this request started is retired and the run is cancelled rather than left half-running.
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
plan | object | no | — |
planId | string | no | A saved preset; used when plan is absent |
items | object[] | yes | — |
brandId | string | null | no | — |
idempotencyKey | string | no | — |
{
"plan": {},
"planId": "string",
"items": [
{}
],
"brandId": "string",
"idempotencyKey": "string"
}Responses
| Status | Meaning |
|---|---|
202 | The line is running |
400 | BAD_BODY / BAD_PLAN / BAD_ITEMS |
401 | No valid session |
402 | INSUFFICIENT_TOKENS { need, spendable } |
403 | A viewer may not spend the house's tokens |
404 | PRESET_NOT_FOUND / ASSET_NOT_FOUND |
422 | LINE_TOO_WIDE |
202 returns:
{
"runId": "string",
"developId": "string",
"started": 0,
"compiled": {}
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/pipelines/runs" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan":{},"planId":"string","items":[{}],"brandId":"string","idempotencyKey":"string"}'GET /api/toolkit/pipelines/runs/{id}
One run, its compiled steps and its plan
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | The run |
401 | No valid session |
404 | NOT_FOUND |
200 returns:
{
"run": {
"id": "string",
"name": "string",
"developId": "string",
"status": "developing",
"framesPlanned": 0,
"framesSkipped": 0,
"tokensPlanned": 0,
"tokensSpent": 0,
"steps": {
"done": 0,
"failed": 0,
"cancelled": 0,
"active": 0,
"total": 0
},
"line": "string",
"createdAt": "2026-07-27T09:00:00.000Z"
},
"steps": [
{}
],
"plan": {}
}Call it
curl -X GET "https://api.flam.fashion/api/toolkit/pipelines/runs/{id}" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/toolkit/pipelines/runs/{id}/cancel
Stop the line
The run is flagged FIRST so the scheduler stops enqueueing, then every queued frame is claimed and released. A frame already rendering finishes and still costs. Never implies a refund that is not happening.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | What actually stopped |
401 | No valid session |
404 | NOT_FOUND |
200 returns:
{
"id": "string",
"cancelled": 0,
"cancelledJobIds": [
"string"
],
"stillRendering": 0,
"tokensReleased": 0,
"run": {
"id": "string",
"name": "string",
"developId": "string",
"status": "developing",
"framesPlanned": 0,
"framesSkipped": 0,
"tokensPlanned": 0,
"tokensSpent": 0,
"steps": {
"done": 0,
"failed": 0,
"cancelled": 0,
"active": 0,
"total": 0
},
"line": "string",
"createdAt": "2026-07-27T09:00:00.000Z"
}
}Call it
curl -X POST "https://api.flam.fashion/api/toolkit/pipelines/runs/{id}/cancel" \
-H "Authorization: Bearer $FLAM_API_KEY"