BUZZ AI Gateway
Docs · API Reference · Billing

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.

GET https://buzzai.cc/v1/dashboard/billing/subscription
GET https://buzzai.cc/v1/dashboard/billing/usage
OpenAI-compatible shape, BUZZ semantics. The JSON shape mirrors OpenAI's legacy dashboard billing endpoints, so OpenAI-style balance checkers and reverse-proxy UIs work without modification. The numeric meaning follows the site's quota-display setting — see QuotaDisplayType.

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.

HeaderNotes
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:

QuotaDisplayTypeConversionWhat the response number means
USD (default)amount = quota / QuotaPerUnitUS dollars.
CNYamount = quota / QuotaPerUnit * USDExchangeRateLocal currency, applied via the site's exchange rate.
Tokensamount = quotaRaw 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

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

FieldTypeDescription
objectstringAlways "billing_subscription".
has_payment_methodbooleanHard-coded true for OpenAI-shape compatibility. Do not infer payment status from this field.
soft_limit_usdnumberRemain + used quota, converted via QuotaDisplayType (see above). Despite the name, the unit is not always USD.
hard_limit_usdnumberSame value as soft_limit_usd.
system_hard_limit_usdnumberSame value as soft_limit_usd.
access_untilintegerToken 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

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 unit
const 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

FieldTypeDescription
objectstringAlways "list" (kept for OpenAI-shape compatibility, even though no items array is returned).
total_usagenumberCumulative consumption × 100. Divide by 100 to recover the display unit.

Errors

HTTPerror.typeCause
401buzz_errorMissing or invalid sk- token.
429buzz_errorGlobal API rate limit hit.
500upstream_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