Billing
BUZZ exposes two OpenAI-style dashboard billing endpoints so existing tooling (the OpenAI /dashboard/billing/* probes used by many balance-checker scripts and proxy UIs) works out of the box. They report balance and usage in whatever currency unit the site is configured to display.
Authentication
Both endpoints require a user API token (an sk--prefixed key created from the BUZZ console). They run through the relay token-auth chain, the same one used by /v1/messages and /v1/chat/completions.
| Header | Notes |
|---|---|
Authorization: Bearer sk-<TOKEN> | The sk- prefix is automatically stripped server-side. The first hyphen-separated segment is treated as the lookup key. |
No Buzz-User header required — the token already encodes the owner.
QuotaDisplayType: how numbers are calculated
BUZZ stores everything as raw integer "quota units" internally and converts to a human-friendly number only when serving these endpoints. The conversion depends on the site's QuotaDisplayType operation setting:
| QuotaDisplayType | Conversion | What the response number means |
|---|---|---|
| USD (default) | amount = quota / QuotaPerUnit | US dollars. |
| CNY | amount = quota / QuotaPerUnit * USDExchangeRate | Local currency, applied via the site's exchange rate. |
| Tokens | amount = quota | Raw quota units; treat the number as token-equivalents, not currency. |
This means soft_limit_usd in the subscription response and total_usage in the usage response are not always USD. The field name is preserved for OpenAI compatibility, but the actual unit follows the site's display-type setting. Treat the unit as opaque and align it with whatever currency your site shows in the dashboard UI.
GET /v1/dashboard/billing/subscription
Returns the token's (or, when token-level stats are disabled, the user's) remaining-plus-used quota, formatted as if it were a "credit limit". This is what most balance-checker tools poll.
Source of numbers
- If the site has token-level stats enabled:
quota = token.RemainQuota + token.UsedQuota,access_until = token.ExpiredTime. - Otherwise:
quota = user.Quota + user.UsedQuota,access_until = 0. - If the token is unlimited, the response value is overridden to
100000000. - If the token has no expiry,
access_untilis forced to0.
Example request
curl -s 'https://buzzai.cc/v1/dashboard/billing/subscription' \
-H "Authorization: Bearer sk-$BUZZ_TOKEN"import os, requests
resp = requests.get(
"https://buzzai.cc/v1/dashboard/billing/subscription",
headers={"Authorization": f"Bearer sk-{os.environ['BUZZ_TOKEN']}"},
timeout=10,
)
data = resp.json()
print(data["soft_limit_usd"], data["access_until"])const resp = await fetch(
"https://buzzai.cc/v1/dashboard/billing/subscription",
{ headers: { Authorization: `Bearer sk-${process.env.BUZZ_TOKEN}` } },
);
const data = await resp.json();
console.log(data.soft_limit_usd, data.access_until);Live response
{
"object": "billing_subscription",
"has_payment_method": true,
"soft_limit_usd": 1234.622754,
"hard_limit_usd": 1234.622754,
"system_hard_limit_usd": 1234.622754,
"access_until": 0
}
Verified live on 2026-05-26 with a regular limited-quota token. The three limit fields share a single value; access_until = 0 matches a no-expiry token.
Response fields
| Field | Type | Description |
|---|---|---|
| object | string | Always "billing_subscription". |
| has_payment_method | boolean | Hard-coded true for OpenAI-shape compatibility. Do not infer payment status from this field. |
| soft_limit_usd | number | Remain + used quota, converted via QuotaDisplayType (see above). Despite the name, the unit is not always USD. |
| hard_limit_usd | number | Same value as soft_limit_usd. |
| system_hard_limit_usd | number | Same value as soft_limit_usd. |
| access_until | integer | Token expiry as a Unix epoch (seconds). 0 if the token has no expiry. |
GET /v1/dashboard/billing/usage
Returns lifetime consumed quota for the calling token (or user). OpenAI's original endpoint is per-period; this BUZZ implementation returns a single cumulative number and ignores any date-range query parameters.
Source of numbers
- If the site has token-level stats enabled:
quota = token.UsedQuota. - Otherwise:
quota = GetUserUsedQuota(userId). - The same QuotaDisplayType conversion is applied to produce
amount. - Final result is multiplied by 100:
total_usage = amount * 100. The codebase comment calls this "unit: 0.01 dollar" — i.e. cents when display is USD. With CNY display the field iscents-of-CNY * exchange rate; with Tokens display it istokens * 100.
Example request
curl -s 'https://buzzai.cc/v1/dashboard/billing/usage' \
-H "Authorization: Bearer sk-$BUZZ_TOKEN"import os, requests
resp = requests.get(
"https://buzzai.cc/v1/dashboard/billing/usage",
headers={"Authorization": f"Bearer sk-{os.environ['BUZZ_TOKEN']}"},
timeout=10,
)
total_cents = resp.json()["total_usage"]
print(f"used: {total_cents / 100:.2f}") # divide by 100 to recover the display unitconst resp = await fetch(
"https://buzzai.cc/v1/dashboard/billing/usage",
{ headers: { Authorization: `Bearer sk-${process.env.BUZZ_TOKEN}` } },
);
const { total_usage } = await resp.json();
console.log(`used: ${(total_usage / 100).toFixed(2)}`);Live response
{
"object": "list",
"total_usage": 117621.9826
}
Verified live on 2026-05-26. The number is "display-unit × 100" — divide by 100 to get the value you see in the dashboard.
Response fields
| Field | Type | Description |
|---|---|---|
| object | string | Always "list" (kept for OpenAI-shape compatibility, even though no items array is returned). |
| total_usage | number | Cumulative consumption × 100. Divide by 100 to recover the display unit. |
Errors
| HTTP | error.type | Cause |
|---|---|---|
| 401 | buzz_error | Missing or invalid sk- token. |
| 429 | buzz_error | Global API rate limit hit. |
| 500 | upstream_error (subscription) / buzz_error (usage) | Failed to load token or user state. The two endpoints differ here: subscription tags the type as upstream_error, usage tags it as buzz_error. |
See also
GET /api/user/self— for the rawquotainteger plus group / affiliate metadataGET /api/token/— managesk-tokens- Authentication guide