Code Buckets
Get usage
Tokens this month and storage.
Your Code Buckets plan, this month's tokens and your storage. Also works with a key that has only account:read.
Authorizations
AuthorizationstringrequiredYour API key as a bearer token: Bearer clsk_.... Create keys in the Console with the Code Buckets permissions you need.
X-Clatter-AccountstringrequiredThe Account ID that owns the key, like CL-7K2M9QXA. Find it in Console › Settings. A missing value answers 401 missing_account_id; someone else's answers 401 account_mismatch.
Response
200 · application/json
objectstringusage.
planstringFree, or unlimited for Clatter Labs team accounts.
periodobject{ month }, like 2026-10 (UTC).
tokensobject{ used, included, unit }. included is 1,000,000 on Free.
storageobject{ projects, buckets, stored_bytes, bucket_limit_bytes, backups_used, backups_included, public_files }. public_files is this month's traffic to your public links: { month, requests, bytes, tokens }.
Errors
| Status | Code | When |
|---|---|---|
401 | invalid_api_key / missing_account_id / account_mismatch | The key or Account ID is wrong. |
403 | insufficient_scope | The key needs buckets:read or account:read. |
curl "https://api.codebuckets.clatterlabs.xyz/v1/usage" \
-H "Authorization: Bearer $CLATTER_API_KEY" \
-H "X-Clatter-Account: $CLATTER_ACCOUNT_ID"import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['CLATTER_API_KEY']}",
"X-Clatter-Account": os.environ["CLATTER_ACCOUNT_ID"],
}
r = requests.get("https://api.codebuckets.clatterlabs.xyz/v1/usage", headers=headers)
print(r.json())const headers = {
Authorization: `Bearer ${process.env.CLATTER_API_KEY}`,
"X-Clatter-Account": process.env.CLATTER_ACCOUNT_ID,
};
const res = await fetch("https://api.codebuckets.clatterlabs.xyz/v1/usage", {
method: "GET",
headers,
});
console.log(await res.json());{
"object": "usage",
"plan": "Free",
"period": {
"month": "2026-10"
},
"tokens": {
"used": 1342,
"included": 1000000,
"unit": "1 per request + 1 per MiB uploaded or downloaded"
},
"storage": {
"projects": 1,
"buckets": 1,
"stored_bytes": 131204115,
"bucket_limit_bytes": 10737418240,
"backups_used": 1,
"backups_included": 1,
"public_files": {
"month": "2026-10",
"requests": 1840,
"bytes": 96468992,
"tokens": 1932
}
}
}