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
| Route | What it does |
|---|---|
GET /api/keys | List the house's API keys |
POST /api/keys | Mint an organisation API key |
DELETE /api/keys/{id} | Revoke an API key |
MCP
| Route | What it does |
|---|---|
POST /api/mcp | MCP server (Streamable HTTP, JSON responses) |
Meta
| Route | What it does |
|---|---|
GET /docs | Swagger UI rendered over /openapi.json |
GET /health | Liveness |
GET /openapi.json | The merged OpenAPI document this API serves |
Assets
| Route | What it does |
|---|---|
GET /api/toolkit/assets | The 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}/file | Stream one asset's bytes (the contract serving route) |
POST /api/toolkit/assets/group | Stamp a fresh shared group onto a set of pieces |
POST /api/toolkit/assets/upload | Hang one image in the house library (multipart) |
GET /api/toolkit/backgrounds | The whole library a look can stand on |
GET /api/toolkit/folders | Every collection in the house, flat |
POST /api/toolkit/folders | Create a collection |
PATCH /api/toolkit/folders/{id} | Rename a collection |
Jobs
| Route | What it does |
|---|---|
GET /api/toolkit/develops | The house's develop RUNS, newest first |
POST /api/toolkit/develops/{id}/cancel | Stop a whole run — honestly |
GET /api/toolkit/jobs | Reconnect backfill — jobs newer than an eventSeq cursor |
POST /api/toolkit/jobs/{id}/cancel | Stop ONE frame |
POST /api/toolkit/jobs/{id}/duplicate | Run the same frame again as a NEW job |
POST /api/toolkit/jobs/submit | Submit an async generation job |
GET /api/toolkit/jobs/ws | Job event stream (WebSocket upgrade) |
Lookbook
| Route | What it does |
|---|---|
GET /api/toolkit/lookbook/looks | The house's looks, newest first (50) |
POST /api/toolkit/lookbook/looks | Create 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-lock | Develop the LOOK's lock frame |
POST /api/toolkit/lookbook/looks/{id}/lock | Freeze the Look Base |
POST /api/toolkit/lookbook/looks/{id}/unlock | The explicit intent required before re-developing a locked look |
POST /api/toolkit/lookbook/looks/{id}/variations | Fan the LOOK out into its variations |
GET /api/toolkit/lookbook/templates | Shot 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
| Route | What it does |
|---|---|
POST /api/toolkit/factory/plan | What the house INTENDS, before a token moves |
POST /api/toolkit/factory/run | The one confirm — create the batch of draft looks |
GET /api/toolkit/presets | The house's standing preset |
POST /api/toolkit/presets | Set the house's standing preset |
Pipelines
| Route | What it does |
|---|---|
GET /api/toolkit/pipelines/presets | Saved plans — a line with no items bound |
POST /api/toolkit/pipelines/presets | Save 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/preview | The number before the click |
GET /api/toolkit/pipelines/runs | The house's pipeline runs, newest first |
POST /api/toolkit/pipelines/runs | Start the line |
GET /api/toolkit/pipelines/runs/{id} | One run, its compiled steps and its plan |
POST /api/toolkit/pipelines/runs/{id}/cancel | Stop the line |
Models
| Route | What it does |
|---|---|
GET /api/toolkit/models | The casting board |
GET /api/toolkit/models/{id} | One face |
POST /api/toolkit/models/{id}/checkout | Open the hosted checkout for a face |
POST /api/toolkit/models/own | Bring your own — register held assets as a personal model |
Brand
| Route | What it does |
|---|---|
GET /api/toolkit/brand | The house's extracted visual DNA |
PATCH /api/toolkit/brand | Correct the extracted DNA, or switch the injection off |
POST /api/toolkit/brand/dna | Read the house's visual DNA off its own imagery |
AI
| Route | What it does |
|---|---|
POST /api/toolkit/ai/depth | Depth map for the Lens Blur tool (1 token) |
POST /api/toolkit/ai/describe-item | Classify one piece — auto-name + wardrobe bucket (1 token) |
POST /api/toolkit/ai/detect-items | Find every garment and accessory in a frame |
POST /api/toolkit/ai/extract-character | Read a person out of a reference image (or a four-view collage) |
POST /api/toolkit/ai/segment | A clean cutout of the ONE item that was tapped |
Toolkit
| Route | What it does |
|---|---|
POST /api/toolkit/ai/remove-background | Remove background (sync, fal birefnet) |
GET /api/toolkit/my-access | — |
GET /api/toolkit/tools/{slug}/items | Curated content items for a tool |
Text tools
| Route | What it does |
|---|---|
POST /api/toolkit/ai/face-features | 20 facial-feature keywords from a portrait (vision lane) |
POST /api/toolkit/ai/inspiration-keywords | Categorized keyword sets for a vibe |
POST /api/toolkit/ai/midjourney-prompts | Generate N varied shot prompts from a reference description |
POST /api/toolkit/ai/prompt-builder | Build one photographic prompt from a subject |
POST /api/toolkit/ai/prompt-enhancer | Improve a rough prompt (sync text lane) |
Explore
| Route | What it does |
|---|---|
GET /api/toolkit/entitlements | What this director holds, and any checkout still open |
GET /api/toolkit/explore | Every offering this director may see, across all kinds |
POST /api/toolkit/explore/{kind}/{id}/take | Take an offering — free grants now, priced opens checkout |
Posts
| Route | What it does |
|---|---|
GET /posts | — |
POST /posts | — |
DELETE /posts/{id} | — |
GET /posts/{id} | — |
PATCH /posts/{id} | — |
Chat
| Route | What it does |
|---|---|
POST /api/chat | One turn of the loop |
POST /api/chat/apply | Undo, redo, and any direct edit |
Search
| Route | What it does |
|---|---|
GET /api/toolkit/search | One field over the whole house |
Billing
| Route | What it does |
|---|---|
GET /api/toolkit/ai/billing/autocharge | The house's auto top-up rule, ceiling, card and audit trail |
PUT /api/toolkit/ai/billing/autocharge | Arm, retune or disarm the auto top-up rule (OWNER ONLY) |
POST /api/toolkit/ai/billing/autocharge/run | Fire the standing order if the house is genuinely short |
GET /api/toolkit/ai/billing/balance | Spendable token balance + open holds |
GET /api/toolkit/ai/billing/catalog | Public pricing catalog (tiers + packs) |
POST /api/toolkit/ai/billing/checkout/custom | Hosted Dodo checkout for a pay-what-you-want top-up |
POST /api/toolkit/ai/billing/checkout/subscription | Hosted Dodo checkout for a subscription tier |
POST /api/toolkit/ai/billing/checkout/topup | Hosted Dodo checkout for a token pack |
POST /api/toolkit/ai/billing/portal | Open the merchant of record's hosted portal (OWNER ONLY) |
POST /api/toolkit/ai/billing/webhook/dodo | Dodo payment webhook (standard-webhooks signature) |
Account
| Route | What it does |
|---|---|
GET /api/account | The director's own account, in one read |
POST /api/account/plan/cancel | Stop the renewal (cancel at period end) |
Me
| Route | What it does |
|---|---|
GET /me | The signed-in user |
POST /me/delete | GDPR erasure — delete the caller's account |
GET /me/export | GDPR access — export the caller's own user row |
Organization
| Route | What it does |
|---|---|
DELETE /api/toolkit/org/seats/{userId} | Empty a seat (or leave the house yourself) |
POST /api/toolkit/org/seats/accept | Take an offered seat |
POST /api/toolkit/org/seats/invite | Invite a teammate into this house |
POST /api/toolkit/org/seats/role | Change what a seat may do |
POST /api/toolkit/org/transfer | Hand this house to somebody else |
Invites
| Route | What it does |
|---|---|
GET /api/toolkit/invite/accept | Look up an invitation token before signing in |
POST /api/toolkit/invite/accept | Accept an invitation as the signed-in user |
POST /api/toolkit/invite/request | Request an invitation to the house |
Onboarding
| Route | What it does |
|---|---|
GET /api/toolkit/onboarding | First-workflow checklist progress |
POST /api/toolkit/onboarding | Complete a checklist step (idempotent) |
Auth
| Route | What it does |
|---|---|
POST /api/toolkit/check-email | Route an entered email to the right sign-in step |
Admin
| Route | What it does |
|---|---|
POST /api/toolkit/admin/access | Grant / revoke toolkit or tool access (admin) |
GET /api/toolkit/admin/ai-costs | Token/cost usage summary from the ledger (admin) |
GET /api/toolkit/admin/develops | Develop runs across the house, newest first |
POST /api/toolkit/admin/develops/action | Retry or cancel a develop |
GET /api/toolkit/admin/emails | Every letter the house sent (email_log) |
GET /api/toolkit/admin/entitlements | Real-money purchases across the house |
POST /api/toolkit/admin/entitlements/revoke | Revoke a granted entitlement (a refund's other half) |
GET /api/toolkit/admin/failures | Failures grouped by what the provider actually said |
GET /api/toolkit/admin/frames | Every house's outputs, browsable |
GET /api/toolkit/admin/frames/{id}/file | The bytes of any house's frame (admin only) |
POST /api/toolkit/admin/grant-tokens | Comp a token grant to a user (admin) |
POST /api/toolkit/admin/invite | Open the door for one email (admin) |
GET /api/toolkit/admin/invite-requests | List invitation requests (admin) |
GET /api/toolkit/admin/offerings | The catalogue, as the house sees it |
POST /api/toolkit/admin/offerings | Create or update an offering (price, tier, previews) |
POST /api/toolkit/admin/offerings/retire | Retire an offering from the board |
GET /api/toolkit/admin/overview | The house at a glance — the first screen |
GET /api/toolkit/admin/payments | Real transactions — subscriptions, top-ups, offerings, comps |
GET /api/toolkit/admin/tokenomics | What a token costs against what we charge, and the funnel |
DELETE /api/toolkit/admin/tool-items | Delete a curated item by id (admin) |
GET /api/toolkit/admin/tool-items | Curated items for one tool (admin) |
POST /api/toolkit/admin/tool-items | Append a curated item (admin) |
GET /api/toolkit/admin/users | All users with balance + access (admin) |
| Route | What it does |
|---|---|
POST /api/toolkit/email/webhook/resend | Resend delivery webhook (standard-webhooks signature) |
The API
Mint an organization key, send it as a bearer token, and every route answers. An MCP endpoint gives an agent six tools to commission a develop and watch it land. Outbound webhooks are not built.
API keys
3 API keys routes on the FLAM API: List the house's API keys; Mint an organisation API key; Revoke an API key.