FLAM

Brand

3 Brand routes on the FLAM API: The house's extracted visual DNA; Correct the extracted DNA, or switch the injection off; Read the house's visual DNA off.

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/brand

The house's extracted visual DNA

Returns the profile plus clause — the EXACT text the generators will inject, built by the same @flam/ai builder the worker calls, so this review surface can never disagree with the renders. A house that has never run a read gets empty defaults, never a 404.

Responses

StatusMeaning
200The profile
401Unauthorized

200 returns:

{
  "ok": true,
  "profile": {
    "visionEn": "string",
    "vibe": [
      "string"
    ],
    "palette": [
      "string"
    ],
    "signatureKeywords": [
      {
        "category": "string",
        "phrase": "string"
      }
    ],
    "injectEnabled": true,
    "dnaRuns": 0,
    "clause": "string"
  }
}

Call it

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

PATCH /api/toolkit/brand

Correct the extracted DNA, or switch the injection off

The house gets the last word. Every field is optional and merges onto what is stored; the merged result is then clamped exactly as an extraction would be, so a partial edit cannot smuggle past a bound the extractor enforces. injectEnabled: false is the kill switch — the profile stays, the clause goes empty, every generator renders unbranded. dna_runs is never touched here, so editing is free and unlimited.

Request bodyapplication/json (required)

FieldTypeRequiredNotes
visionEnstringno
vibestring[]no
palettestring[]no
signatureKeywordsobject[]no
injectEnabledbooleanno
{
  "visionEn": "string",
  "vibe": [
    "string"
  ],
  "palette": [
    "string"
  ],
  "signatureKeywords": [
    {
      "category": "string",
      "phrase": "string"
    }
  ],
  "injectEnabled": true
}

Responses

StatusMeaning
200The updated profile
400BAD_JSON
401Unauthorized
403A viewer may not edit the clause every render pays for

200 returns:

{
  "ok": true,
  "profile": {
    "visionEn": "string",
    "vibe": [
      "string"
    ],
    "palette": [
      "string"
    ],
    "signatureKeywords": [
      {
        "category": "string",
        "phrase": "string"
      }
    ],
    "injectEnabled": true,
    "dnaRuns": 0,
    "clause": "string"
  }
}

Call it

curl -X PATCH "https://api.flam.fashion/api/toolkit/brand" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"visionEn":"string","vibe":["string"],"palette":["string"],"signatureKeywords":[{"category":"string","phrase":"string"}],"injectEnabled":true}'

POST /api/toolkit/brand/dna

Read the house's visual DNA off its own imagery

The cross-tool magic. Upload 1-10 of the house's own previous frames and one multi-image vision call finds the through-line: vibe, palette, signature cues and a visionEn paragraph that is injected into EVERY packshot, character and lookbook frame the house develops afterwards. The read describes the house faithfully — the 8-category fashion vocabulary is a descriptive lens, never a style to impose. BILLING is server-decided from brand_profiles.dna_runs and never from the client: the FIRST read per house is free (charged 0), every re-read costs 2 tokens. The counter is bumped on every successful read whether or not the house keeps the answer. A failed read charges nothing and does not bump it.

Request bodymultipart/form-data (required)

FieldTypeRequiredNotes
imagefile[]yes
vibestringnoJSON string[] of vibe hints
productsstringnowhat the house sells

Responses

StatusMeaning
200The extracted (and stored) DNA
400NO_IMAGES / BAD_FORM
401Unauthorized
402INSUFFICIENT_TOKENS / AI_NEEDS_BILLING
403A viewer may not spend the house's tokens
413IMAGE_TOO_LARGE / SET_TOO_LARGE (32MB across the set)
502AI_BAD_OUTPUT / AI_FAILED
503AI_NOT_CONFIGURED

200 returns:

{
  "ok": true,
  "profile": {
    "visionEn": "string",
    "vibe": [
      "string"
    ],
    "palette": [
      "string"
    ],
    "signatureKeywords": [
      {
        "category": "string",
        "phrase": "string"
      }
    ],
    "injectEnabled": true,
    "dnaRuns": 0,
    "clause": "string"
  },
  "charged": 0
}

Call it

curl -X POST "https://api.flam.fashion/api/toolkit/brand/dna" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -F "image=<image>" \
  -F "vibe=<vibe>" \
  -F "products=<products>"