Skip to main content

API Reference

Usage

Query API call counts and credit consumption for your account or a specific API key. Every credit-deducting request is logged — usage data is available within seconds of each call.

GET/api/v1/usage🔑 Auth required

Returns a summary of API calls and credits consumed, broken down by endpoint and by day. The response is automatically scoped to the API key used. Pass ?keyId= to query a different key on your account.

  • daily always contains one entry per day in the requested window, even for days with zero activity.
  • key is included only when the response is scoped to a specific API key.
  • byEndpoint keys are the internal action names (image_to_html, code_export, figma_export). Use the label field for display.
  • Credits in this response are absolute values (positive integers), not signed deductions.
  • Upload calls (0 credits) are not logged and will not appear in usage data.

Query Parameters

NameTypeDescription
daysnumberLookback window in days. Accepted values: 1–90. Default: 30.
keyIdstringFilter results to a specific API key ID (must belong to your account). When omitted and authenticated with an API key, defaults to that key.
Response
{  "period": {    "start": "2026-03-13T00:00:00.000Z",    "end":   "2026-04-12T14:30:00.000Z",    "days":  30  },  "key": {    "id":       "clxyz01abc",    "name":     "Production Key",    "lastUsed": "2026-04-12T14:29:00.000Z"  },  "summary": {    "totalCalls":   47,    "totalCredits": 855,    "byEndpoint": {      "image_to_html": {        "calls":   20,        "credits": 600,        "label":   "Image → HTML"      },      "code_export": {        "calls":   18,        "credits": 270,        "label":   "Export Code"      },      "figma_export": {        "calls":    9,        "credits":  90,        "label":   "Figma Export"      }    }  },  "daily": [    { "date": "2026-04-10", "calls": 5,  "credits":  90 },    { "date": "2026-04-11", "calls": 12, "credits": 225 },    { "date": "2026-04-12", "calls":  8, "credits": 150 }  ]}

Fetch your usage

# Last 30 days for the authenticated keycurl "https://www.floow.design/api/v1/usage" \  -H "Authorization: Bearer fl_your_api_key"
# Filter to a specific key, last 7 dayscurl "https://www.floow.design/api/v1/usage?keyId=clxyz01abc&days=7" \  -H "Authorization: Bearer fl_your_api_key"
const res = await fetch(  "https://www.floow.design/api/v1/usage?days=30",  { headers: { Authorization: "Bearer fl_your_api_key" } },);
if (!res.ok) {  const { error } = await res.json();  throw new Error(error);}
const { period, summary, daily } = await res.json();
console.log(`Calls: ${summary.totalCalls}, Credits: ${summary.totalCredits}`);console.log(`Period: ${period.start}${period.end}`);
for (const [action, stats] of Object.entries(summary.byEndpoint)) {  const s = stats as { calls: number; credits: number; label: string };  console.log(`  ${s.label}: ${s.calls} calls, ${s.credits} credits`);}
// Daily breakdowndaily.forEach(({ date, calls, credits }) => {  if (calls > 0) console.log(`${date}: ${calls} calls, ${credits} credits`);});
import requests
res = requests.get(    "https://www.floow.design/api/v1/usage",    params={"days": 30},    headers={"Authorization": "Bearer fl_your_api_key"},)res.raise_for_status()data = res.json()
summary = data["summary"]print(f"Total calls: {summary['totalCalls']}")print(f"Total credits: {summary['totalCredits']}")
for action, stats in summary["byEndpoint"].items():    print(f"  {stats['label']}: {stats['calls']} calls, {stats['credits']} credits")
# Daily breakdown — only days with activityfor day in data["daily"]:    if day["calls"] > 0:        print(f"{day['date']}: {day['calls']} calls, {day['credits']} credits")

Scoping by key

  • Default: the response is scoped to the API key used in the request — no extra params needed.
  • Different key: pass ?keyId=<id> to query any other key that belongs to your account.