FLAM

Toolkit

4 Toolkit routes on the FLAM API: Remove background (sync, fal birefnet); Another take — N frames back in, her sentence on each; Curated content items.

Base URL https://api-staging.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/ai/remove-background

Remove background (sync, fal birefnet)

Request bodymultipart/form-data (required)

FieldTypeRequiredNotes
imagefileyes

Responses

StatusMeaning
200The cutout, in the library
400NO_IMAGE | EMPTY_IMAGE | BAD_FORM
402INSUFFICIENT_TOKENS — body includes need + spendable
403A viewer may look but not spend
413IMAGE_TOO_LARGE (12 MB cap) — body includes maxMb
502REMOVE_BG_FAILED — the engine failed, OR the house could not keep the result. Nothing is charged either way.
503FAL_NOT_CONFIGURED

200 returns:

{
  "url": "string",
  "spent": 0,
  "assetId": "00000000-0000-0000-0000-000000000000"
}

Call it

curl -X POST "https://api-staging.flam.fashion/api/toolkit/ai/remove-background" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -F "image=@image.png"

GET /api/toolkit/my-access

Responses

StatusMeaning
200The active tool + toolkit registry, per-user access
401Unauthenticated

200 returns:

{
  "toolkits": [
    {}
  ],
  "tools": [
    {
      "id": "string",
      "slug": "string",
      "name": "string",
      "sortOrder": 0,
      "accessible": true,
      "settings": [
        {}
      ]
    }
  ],
  "trialExpired": true,
  "trialActive": true,
  "trialDaysLeft": 0
}

Call it

curl -X GET "https://api-staging.flam.fashion/api/toolkit/my-access" \
  -H "Authorization: Bearer $FLAM_API_KEY"

POST /api/toolkit/takes

Another take — N frames back in, her sentence on each

Reserves tokens for every named frame before enqueueing any and releases every fresh hold on any single failure — a 402 leaves zero holds. Each new job carries her sentence verbatim in params.direction, inherits its source's runId, and is chained to the frame it retakes by retryOfJobId. Idempotent on idempotencyKey: a replayed submit answers with the same jobs and charges nothing.

Request bodyapplication/json

FieldTypeRequiredNotes
jobIdsstring[]yes
directionstringno
idempotencyKeystringno
{
  "jobIds": [
    "string"
  ],
  "direction": "string",
  "idempotencyKey": "string"
}

Responses

StatusMeaning
200Replay of an identical submit — the same jobs, nothing charged twice.
202Every frame reserved and queued. offer rides along when the promotion detector has one.
401No session
402INSUFFICIENT_TOKENS — need/spendable are the honest cost line. Zero holds remain.
403A viewer seat may not spend the house's tokens
404A named frame this house does not own
409A named frame is not developed yet, or the idempotency key was reused for a different set
422A named frame cannot run again (retired tool, no inputs)
500Submit failed
503The studio queue is unreachable — released holds for anything not queued

200 returns:

{
  "jobs": [
    {
      "jobId": "string",
      "sourceJobId": "string",
      "tokens": 0
    }
  ],
  "offer": {
    "text": "string",
    "scopeTools": [
      "string"
    ],
    "evidence": [
      {
        "jobId": "string",
        "tool": "string",
        "said": "string",
        "at": "string",
        "shoot": "string"
      }
    ],
    "alreadyStanding": [
      {
        "id": "string",
        "text": "string",
        "scopePhrase": "string"
      }
    ]
  },
  "replayed": true
}

Call it

curl -X POST "https://api-staging.flam.fashion/api/toolkit/takes" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jobIds":["string"],"direction":"string","idempotencyKey":"string"}'

GET /api/toolkit/tools/{slug}/items

Curated content items for a tool

Parameters

InNameTypeRequiredNotes
pathslugstringyes

Responses

StatusMeaning
200tool_items rows, ordered per category by sort_order
400Invalid input
401No valid session

200 returns:

{
  "items": [
    {
      "id": "string",
      "tool_id": "string",
      "category": "string",
      "title_he": "string",
      "label_he": "string",
      "content_en": "string",
      "image_url": "string",
      "notes_he": "string",
      "sort_order": 0,
      "created_at": "2026-07-27T09:00:00.000Z"
    }
  ]
}

Call it

curl -X GET "https://api-staging.flam.fashion/api/toolkit/tools/{slug}/items" \
  -H "Authorization: Bearer $FLAM_API_KEY"