FLAM

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

InNameTypeRequiredNotes
querydays7 | 30 | 90noSpend window — 7, 30 or 90. Anything else falls back to 30.

Responses

StatusMeaning
200The account
401No 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

StatusMeaning
200The plan will not renew
401No valid session
404NO_ACTIVE_PLAN — nothing is renewing
502CANCEL_FAILED — the provider refused; nothing was changed here
503BILLING_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"