FLAM

API reference

Every one of the 127 routes the FLAM API serves, generated from the OpenAPI document the API itself publishes — parameters, responses and a runnable curl for each.

127 operations in 26 groups. Each group is one page: every route in it with its parameters, its responses, an example body and a curl you can paste. The pages are built from the running contract on every deploy — a route that answers is on this page, and a route that is gone has left it.

Built for agents as much as for people

The machine-readable document is on this origin at /openapi.json — point a generated client, a typed SDK or an agent at it directly. An MCP server is at POST /api/mcp, which is the shorter path for an agent that just wants to commission work and watch it land.

Start here

# 1. Mint an organisation key (needs a browser session — a key cannot mint a key).
curl -X POST "https://api.flam.fashion/api/keys" \
  -H "Content-Type: application/json" \
  -b "$SESSION_COOKIE" \
  -d '{"name":"my agent","role":"member"}'

# 2. Every call after that is the same header.
export FLAM_API_KEY="flam_sk_…"
curl "https://api.flam.fashion/api/me" -H "Authorization: Bearer $FLAM_API_KEY"

A key belongs to the organisation, not to a person: the organisation owns the work, the imagery and the money, and a person is only attribution. Taking someone off the team cannot orphan a running integration. Roles, revocation and what a key may never do are on The API.

Every route

API keys

RouteWhat it does
GET /api/keysList the house's API keys
POST /api/keysMint an organisation API key
DELETE /api/keys/{id}Revoke an API key

MCP

RouteWhat it does
POST /api/mcpMCP server (Streamable HTTP, JSON responses)

Meta

RouteWhat it does
GET /docsSwagger UI rendered over /openapi.json
GET /healthLiveness
GET /openapi.jsonThe merged OpenAPI document this API serves

Assets

RouteWhat it does
GET /api/toolkit/assetsThe house's captured assets, newest first
GET /api/toolkit/assets/{id}Stream one asset's bytes from R2 (owner-gated)
PATCH /api/toolkit/assets/{id}Rename, classify, tag or move one piece
GET /api/toolkit/assets/{id}/fileStream one asset's bytes (the contract serving route)
POST /api/toolkit/assets/groupStamp a fresh shared group onto a set of pieces
POST /api/toolkit/assets/uploadHang one image in the house library (multipart)
GET /api/toolkit/backgroundsThe whole library a look can stand on
GET /api/toolkit/foldersEvery collection in the house, flat
POST /api/toolkit/foldersCreate a collection
PATCH /api/toolkit/folders/{id}Rename a collection

Jobs

RouteWhat it does
GET /api/toolkit/developsThe house's develop RUNS, newest first
POST /api/toolkit/develops/{id}/cancelStop a whole run — honestly
GET /api/toolkit/jobsReconnect backfill — jobs newer than an eventSeq cursor
POST /api/toolkit/jobs/{id}/cancelStop ONE frame
POST /api/toolkit/jobs/{id}/duplicateRun the same frame again as a NEW job
POST /api/toolkit/jobs/submitSubmit an async generation job
GET /api/toolkit/jobs/wsJob event stream (WebSocket upgrade)

Lookbook

RouteWhat it does
GET /api/toolkit/lookbook/looksThe house's looks, newest first (50)
POST /api/toolkit/lookbook/looksCreate a look from the director's three choices
GET /api/toolkit/lookbook/looks/{id}One look, whole — selections, lock state, the variation batch
POST /api/toolkit/lookbook/looks/{id}/develop-lockDevelop the LOOK's lock frame
POST /api/toolkit/lookbook/looks/{id}/lockFreeze the Look Base
POST /api/toolkit/lookbook/looks/{id}/unlockThe explicit intent required before re-developing a locked look
POST /api/toolkit/lookbook/looks/{id}/variationsFan the LOOK out into its variations
GET /api/toolkit/lookbook/templatesShot templates — the house's built-ins plus the caller's own
GET /api/toolkit/lookbook/templates/{id}One template and its shots, in order

Factory

RouteWhat it does
POST /api/toolkit/factory/planWhat the house INTENDS, before a token moves
POST /api/toolkit/factory/runThe one confirm — create the batch of draft looks
GET /api/toolkit/presetsThe house's standing preset
POST /api/toolkit/presetsSet the house's standing preset

Pipelines

RouteWhat it does
GET /api/toolkit/pipelines/presetsSaved plans — a line with no items bound
POST /api/toolkit/pipelines/presetsSave a plan as a preset
DELETE /api/toolkit/pipelines/presets/{id}Delete a saved plan
PATCH /api/toolkit/pipelines/presets/{id}Replace a saved plan
POST /api/toolkit/pipelines/previewThe number before the click
GET /api/toolkit/pipelines/runsThe house's pipeline runs, newest first
POST /api/toolkit/pipelines/runsStart the line
GET /api/toolkit/pipelines/runs/{id}One run, its compiled steps and its plan
POST /api/toolkit/pipelines/runs/{id}/cancelStop the line

Models

RouteWhat it does
GET /api/toolkit/modelsThe casting board
GET /api/toolkit/models/{id}One face
POST /api/toolkit/models/{id}/checkoutOpen the hosted checkout for a face
POST /api/toolkit/models/ownBring your own — register held assets as a personal model

Brand

RouteWhat it does
GET /api/toolkit/brandThe house's extracted visual DNA
PATCH /api/toolkit/brandCorrect the extracted DNA, or switch the injection off
POST /api/toolkit/brand/dnaRead the house's visual DNA off its own imagery

AI

RouteWhat it does
POST /api/toolkit/ai/depthDepth map for the Lens Blur tool (1 token)
POST /api/toolkit/ai/describe-itemClassify one piece — auto-name + wardrobe bucket (1 token)
POST /api/toolkit/ai/detect-itemsFind every garment and accessory in a frame
POST /api/toolkit/ai/extract-characterRead a person out of a reference image (or a four-view collage)
POST /api/toolkit/ai/segmentA clean cutout of the ONE item that was tapped

Toolkit

RouteWhat it does
POST /api/toolkit/ai/remove-backgroundRemove background (sync, fal birefnet)
GET /api/toolkit/my-access
GET /api/toolkit/tools/{slug}/itemsCurated content items for a tool

Text tools

RouteWhat it does
POST /api/toolkit/ai/face-features20 facial-feature keywords from a portrait (vision lane)
POST /api/toolkit/ai/inspiration-keywordsCategorized keyword sets for a vibe
POST /api/toolkit/ai/midjourney-promptsGenerate N varied shot prompts from a reference description
POST /api/toolkit/ai/prompt-builderBuild one photographic prompt from a subject
POST /api/toolkit/ai/prompt-enhancerImprove a rough prompt (sync text lane)

Explore

RouteWhat it does
GET /api/toolkit/entitlementsWhat this director holds, and any checkout still open
GET /api/toolkit/exploreEvery offering this director may see, across all kinds
POST /api/toolkit/explore/{kind}/{id}/takeTake an offering — free grants now, priced opens checkout

Posts

Chat

RouteWhat it does
POST /api/chatOne turn of the loop
POST /api/chat/applyUndo, redo, and any direct edit
RouteWhat it does
GET /api/toolkit/searchOne field over the whole house

Billing

RouteWhat it does
GET /api/toolkit/ai/billing/autochargeThe house's auto top-up rule, ceiling, card and audit trail
PUT /api/toolkit/ai/billing/autochargeArm, retune or disarm the auto top-up rule (OWNER ONLY)
POST /api/toolkit/ai/billing/autocharge/runFire the standing order if the house is genuinely short
GET /api/toolkit/ai/billing/balanceSpendable token balance + open holds
GET /api/toolkit/ai/billing/catalogPublic pricing catalog (tiers + packs)
POST /api/toolkit/ai/billing/checkout/customHosted Dodo checkout for a pay-what-you-want top-up
POST /api/toolkit/ai/billing/checkout/subscriptionHosted Dodo checkout for a subscription tier
POST /api/toolkit/ai/billing/checkout/topupHosted Dodo checkout for a token pack
POST /api/toolkit/ai/billing/portalOpen the merchant of record's hosted portal (OWNER ONLY)
POST /api/toolkit/ai/billing/webhook/dodoDodo payment webhook (standard-webhooks signature)

Account

RouteWhat it does
GET /api/accountThe director's own account, in one read
POST /api/account/plan/cancelStop the renewal (cancel at period end)

Me

RouteWhat it does
GET /meThe signed-in user
POST /me/deleteGDPR erasure — delete the caller's account
GET /me/exportGDPR access — export the caller's own user row

Organization

RouteWhat it does
DELETE /api/toolkit/org/seats/{userId}Empty a seat (or leave the house yourself)
POST /api/toolkit/org/seats/acceptTake an offered seat
POST /api/toolkit/org/seats/inviteInvite a teammate into this house
POST /api/toolkit/org/seats/roleChange what a seat may do
POST /api/toolkit/org/transferHand this house to somebody else

Invites

RouteWhat it does
GET /api/toolkit/invite/acceptLook up an invitation token before signing in
POST /api/toolkit/invite/acceptAccept an invitation as the signed-in user
POST /api/toolkit/invite/requestRequest an invitation to the house

Onboarding

RouteWhat it does
GET /api/toolkit/onboardingFirst-workflow checklist progress
POST /api/toolkit/onboardingComplete a checklist step (idempotent)

Auth

RouteWhat it does
POST /api/toolkit/check-emailRoute an entered email to the right sign-in step

Admin

RouteWhat it does
POST /api/toolkit/admin/accessGrant / revoke toolkit or tool access (admin)
GET /api/toolkit/admin/ai-costsToken/cost usage summary from the ledger (admin)
GET /api/toolkit/admin/developsDevelop runs across the house, newest first
POST /api/toolkit/admin/develops/actionRetry or cancel a develop
GET /api/toolkit/admin/emailsEvery letter the house sent (email_log)
GET /api/toolkit/admin/entitlementsReal-money purchases across the house
POST /api/toolkit/admin/entitlements/revokeRevoke a granted entitlement (a refund's other half)
GET /api/toolkit/admin/failuresFailures grouped by what the provider actually said
GET /api/toolkit/admin/framesEvery house's outputs, browsable
GET /api/toolkit/admin/frames/{id}/fileThe bytes of any house's frame (admin only)
POST /api/toolkit/admin/grant-tokensComp a token grant to a user (admin)
POST /api/toolkit/admin/inviteOpen the door for one email (admin)
GET /api/toolkit/admin/invite-requestsList invitation requests (admin)
GET /api/toolkit/admin/offeringsThe catalogue, as the house sees it
POST /api/toolkit/admin/offeringsCreate or update an offering (price, tier, previews)
POST /api/toolkit/admin/offerings/retireRetire an offering from the board
GET /api/toolkit/admin/overviewThe house at a glance — the first screen
GET /api/toolkit/admin/paymentsReal transactions — subscriptions, top-ups, offerings, comps
GET /api/toolkit/admin/tokenomicsWhat a token costs against what we charge, and the funnel
DELETE /api/toolkit/admin/tool-itemsDelete a curated item by id (admin)
GET /api/toolkit/admin/tool-itemsCurated items for one tool (admin)
POST /api/toolkit/admin/tool-itemsAppend a curated item (admin)
GET /api/toolkit/admin/usersAll users with balance + access (admin)

Email

RouteWhat it does
POST /api/toolkit/email/webhook/resendResend delivery webhook (standard-webhooks signature)