Cabinhub News API v1.0.0

Docs / Admin Usage

Admin Usage

Per-customer invoicing totals (operator).

GET/v1/admin/usage
Auth
X-Admin-Token
Cache-Control
no-store
Source of truth
clients/openapi.json and docs/API.md §12

Per-customer totals for invoicing. Customers with no traffic appear with zeros.

Description: docs/API.md §12

Parameters

NameInRequiredTypeExampleNotes
monthquerynostring2026-11YYYY-MM; defaults to the current UTC month
X-Admin-TokenheadernostringOperator token (NEWS_ADMIN_TOKEN). A client bearer is refused here.

Example request

curl
Shell
curl -sS \
  'https://vg.tempproject.online/v1/admin/usage?month=2026-11' \
  -H "X-Admin-Token: $NEWS_ADMIN_TOKEN"
Python, standard library only
Python
import json
import os
import urllib.request

URL = "https://vg.tempproject.online/v1/admin/usage?month=2026-11"


def call() -> dict:
    req = urllib.request.Request(URL, headers={
        "X-Admin-Token": os.environ["NEWS_ADMIN_TOKEN"],
    })
    with urllib.request.urlopen(req, timeout=15) as res:
        print(res.status, res.headers.get("ETag"))
        return json.loads(res.read().decode("utf-8"))


if __name__ == "__main__":
    body = call()
    print(json.dumps(body, indent=2, ensure_ascii=False)[:2000])
TypeScript, Node 18+, no dependencies
TypeScript
const res = await fetch(
  "https://vg.tempproject.online/v1/admin/usage?month=2026-11",
  {
    method: "GET",
    headers: {
      "x-admin-token": process.env.NEWS_ADMIN_TOKEN!,
    },
  },
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());

The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.

Example response

Response body
JSON
{
  "month": "2026-11",
  "generated_at": "2026-11-04T21:29:18.709180Z",
  "customers": [
    {
      "customer": "vg",
      "billable_items": 4,
      "requests": 9,
      "items_served": 15,
      "keys": [{"key_id": 1, "plan": "starter", "monthly_quota": 45000, "revoked": false,
                "billable_items": 4, "requests": 9, "items_served": 15}],
      "plans": ["starter"],
      "monthly_quota": 45000,
      "active_keys": 1
    }
  ],
  "totals": {"billable_items": 4, "requests": 9, "items_served": 15}
}

Response example in docs/API.md §12 (GET /v1/admin/usage)

Failures

This operation can answer 200, 400, 401, 404, 409, 422, 503. The full envelope for each status, with its body, is on Errors.