Account
2 Account routes on the FLAM API: The director's own account, in one read; Stop the renewal (cancel at period end).
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/account
The director's own account, in one read
Profile, current plan, token balance WITH where those tokens went by workflow, and the book of money that actually landed. Deliberately does NOT re-serve what already has a door: name/avatar, password, social linking and sessions are Better Auth (/api/auth/*); plan and pack prices are /api/toolkit/ai/billing/catalog; upgrades and top-ups are the checkout routes; export/erase are /me/export and /me/delete.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | days | 7 | 30 | 90 | no | Spend window — 7, 30 or 90. Anything else falls back to 30. |
Responses
| Status | Meaning |
|---|---|
200 | The account |
401 | No valid session |
200 returns:
{
"profile": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"joinedAt": "2026-07-27T09:00:00.000Z"
},
"plan": {
"tier": "string",
"name": "string",
"status": "trialing",
"priceUsd": 0,
"monthlyTokens": 0,
"rolloverMultiple": 0,
"renewsAt": "2026-07-27T09:00:00.000Z"
},
"tokens": {
"balance": 0,
"grant": 0,
"topup": 0,
"held": 0,
"days": 7,
"byWorkflow": [
{
"workflow": "string",
"tokens": 0,
"runs": 0,
"lastAt": "2026-07-27T09:00:00.000Z"
}
]
},
"invoices": [
{
"id": "string",
"at": "2026-07-27T09:00:00.000Z",
"kind": "subscription_grant",
"item": "string",
"tokens": 0,
"amountUsd": 0,
"reference": "string"
}
],
"billing": {
"cardOnFile": true
}
}Call it
curl -X GET "https://api.flam.fashion/api/account" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/account/plan/cancel
Stop the renewal (cancel at period end)
Cancel means "do not renew", never "take it back now" — every token already granted stays, and the plan runs to the end of the period it is paid for. The provider is told first and our row is mirrored only on its yes, so a failed vendor call can never leave a director believing they cancelled while the card is still charged. Grants nothing; the webhook remains the only thing that grants.
Responses
| Status | Meaning |
|---|---|
200 | The plan will not renew |
401 | No valid session |
404 | NO_ACTIVE_PLAN — nothing is renewing |
502 | CANCEL_FAILED — the provider refused; nothing was changed here |
503 | BILLING_NOT_CONFIGURED — no provider credentials |
200 returns:
{
"status": "canceled",
"endsAt": "2026-07-27T09:00:00.000Z"
}Call it
curl -X POST "https://api.flam.fashion/api/account/plan/cancel" \
-H "Authorization: Bearer $FLAM_API_KEY"Billing
10 Billing routes on the FLAM API: The house's auto top-up rule, ceiling, card and audit trail; Arm, retune or disarm the auto top-up rule (OWNER ONLY).
Me
3 Me routes on the FLAM API: The signed-in user; GDPR erasure — delete the caller's account; GDPR access — export the caller's own user row.