FLAM

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

StatusMeaning
200The presets, newest first (100)
401No 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 bodyapplication/json (required)

FieldTypeRequiredNotes
planobjectno
{
  "plan": {}
}

Responses

StatusMeaning
201The saved preset
400BAD_BODY / BAD_PLAN
401No 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

InNameTypeRequiredNotes
pathidstringyes

Responses

StatusMeaning
200Deleted
401No valid session
404NOT_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

InNameTypeRequiredNotes
pathidstringyes

Request bodyapplication/json (required)

FieldTypeRequiredNotes
planobjectno
{
  "plan": {}
}

Responses

StatusMeaning
200The updated preset
400BAD_BODY / BAD_PLAN
401No valid session
404NOT_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 bodyapplication/json (required)

FieldTypeRequiredNotes
planobjectyesA pipeline plan { id?, name, nodes }
itemsobject[]yes
{
  "plan": {},
  "items": [
    {}
  ]
}

Responses

StatusMeaning
200The compiled line + affordability
400BAD_BODY / BAD_PLAN / BAD_ITEMS
401No valid session
404ASSET_NOT_FOUND
422LINE_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

StatusMeaning
200The runs
401No 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 bodyapplication/json (required)

FieldTypeRequiredNotes
planobjectno
planIdstringnoA saved preset; used when plan is absent
itemsobject[]yes
brandIdstring | nullno
idempotencyKeystringno
{
  "plan": {},
  "planId": "string",
  "items": [
    {}
  ],
  "brandId": "string",
  "idempotencyKey": "string"
}

Responses

StatusMeaning
202The line is running
400BAD_BODY / BAD_PLAN / BAD_ITEMS
401No valid session
402INSUFFICIENT_TOKENS { need, spendable }
403A viewer may not spend the house's tokens
404PRESET_NOT_FOUND / ASSET_NOT_FOUND
422LINE_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

InNameTypeRequiredNotes
pathidstringyes

Responses

StatusMeaning
200The run
401No valid session
404NOT_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

InNameTypeRequiredNotes
pathidstringyes

Responses

StatusMeaning
200What actually stopped
401No valid session
404NOT_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"