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
| Status | Meaning |
|---|---|
200 | The profile |
401 | Unauthorized |
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 body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
visionEn | string | no | — |
vibe | string[] | no | — |
palette | string[] | no | — |
signatureKeywords | object[] | no | — |
injectEnabled | boolean | no | — |
{
"visionEn": "string",
"vibe": [
"string"
],
"palette": [
"string"
],
"signatureKeywords": [
{
"category": "string",
"phrase": "string"
}
],
"injectEnabled": true
}Responses
| Status | Meaning |
|---|---|
200 | The updated profile |
400 | BAD_JSON |
401 | Unauthorized |
403 | A 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 body — multipart/form-data (required)
| Field | Type | Required | Notes |
|---|---|---|---|
image | file[] | yes | — |
vibe | string | no | JSON string[] of vibe hints |
products | string | no | what the house sells |
Responses
| Status | Meaning |
|---|---|
200 | The extracted (and stored) DNA |
400 | NO_IMAGES / BAD_FORM |
401 | Unauthorized |
402 | INSUFFICIENT_TOKENS / AI_NEEDS_BILLING |
403 | A viewer may not spend the house's tokens |
413 | IMAGE_TOO_LARGE / SET_TOO_LARGE (32MB across the set) |
502 | AI_BAD_OUTPUT / AI_FAILED |
503 | AI_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>"