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 body — multipart/form-data (required)
| Field | Type | Required | Notes |
|---|---|---|---|
image | file | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | The cutout, in the library |
400 | NO_IMAGE | EMPTY_IMAGE | BAD_FORM |
402 | INSUFFICIENT_TOKENS — body includes need + spendable |
403 | A viewer may look but not spend |
413 | IMAGE_TOO_LARGE (12 MB cap) — body includes maxMb |
502 | REMOVE_BG_FAILED — the engine failed, OR the house could not keep the result. Nothing is charged either way. |
503 | FAL_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
| Status | Meaning |
|---|---|
200 | The active tool + toolkit registry, per-user access |
401 | Unauthenticated |
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 body — application/json
| Field | Type | Required | Notes |
|---|---|---|---|
jobIds | string[] | yes | — |
direction | string | no | — |
idempotencyKey | string | no | — |
{
"jobIds": [
"string"
],
"direction": "string",
"idempotencyKey": "string"
}Responses
| Status | Meaning |
|---|---|
200 | Replay of an identical submit — the same jobs, nothing charged twice. |
202 | Every frame reserved and queued. offer rides along when the promotion detector has one. |
401 | No session |
402 | INSUFFICIENT_TOKENS — need/spendable are the honest cost line. Zero holds remain. |
403 | A viewer seat may not spend the house's tokens |
404 | A named frame this house does not own |
409 | A named frame is not developed yet, or the idempotency key was reused for a different set |
422 | A named frame cannot run again (retired tool, no inputs) |
500 | Submit failed |
503 | The 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
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | slug | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | tool_items rows, ordered per category by sort_order |
400 | Invalid input |
401 | No 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"AI
7 AI routes on the FLAM API: Depth map for the Lens Blur tool (1 token); Classify one piece — auto-name + wardrobe bucket (1 token); Find every garment.
Text tools
5 Text tools routes on the FLAM API: 20 facial-feature keywords from a portrait (vision lane); Categorized keyword sets for a vibe; Generate N varied.