BucktDocs

Get usage

GET/v1/billing/usageSDK: billing.getUsage

Returns the organization's current bucket count, total storage used across all buckets, and total bandwidth consumed, each paired with the plan's limit so you can compute headroom in a single round trip. Bandwidth resets at the start of each billing period.

Example request

import { Buckt } from "@buckt/sdk";

const client = new Buckt({ apiKey: process.env.BUCKT_API_KEY });

const usage = await client.billing.getUsage();

Responses

{
  "data": {
    "bucketCount": { "used": 4, "limit": 10 },
    "storage": { "usedBytes": 6442450944, "limitBytes": 107374182400 },
    "bandwidth": { "usedBytes": 12884901888, "limitBytes": 1099511627776 }
  },
  "error": null,
  "meta": null
}