Cabinhub News API v1.0.0

Docs / Usage

Usage

The calling key's month-to-date usage; never quota-blocked.

GET/v1/usage
Auth
client bearer (no quota check)
Cache-Control
no-store
Source of truth
clients/openapi.json and docs/API.md §12

Current-month totals for the calling key:

Usage is per key and per billing month. The figures are this bearer's own rows only: usage (raw traffic, keyed by key + UTC day + endpoint) and usage_items (the billable ledger, keyed by key + UTC month + item). The billing month is the UTC calendar month; the quota resets at resets_at (first instant of the next UTC month), and an item billed in one month is billable again in the next. Reading usage is not billable — these routes never call the meter — and the quota check is deliberately not applied, so a key that has spent its quota can still read why it is being refused.

Requesting another account's numbers is not possible: neither route takes a key_id, customer or key parameter, and an unknown query string (for example ?key_id=7) is ignored. Cross-customer totals exist only on GET /v1/admin/usage, which requires the admin token.

Description: docs/API.md §12

Parameters

NameInRequiredTypeExampleNotes
monthquerynostring2026-11YYYY-MM; defaults to the current UTC month

Example request

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

URL = "https://vg.tempproject.online/v1/usage?month=2026-11"
KEY = os.environ["NEWS_KEY"]


def call() -> dict:
    req = urllib.request.Request(URL, headers={
        "Authorization": f"Bearer {KEY}",
    })
    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/usage?month=2026-11",
  {
    method: "GET",
    headers: {
      authorization: `Bearer ${process.env.NEWS_KEY}`,
    },
  },
);
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",
  "billable_items": 4,
  "by_endpoint": [
    {"endpoint": "/v1/digest/{locale}", "requests": 3, "items_served": 6},
    {"endpoint": "/v1/feed/{locale}", "requests": 2, "items_served": 4},
    {"endpoint": "/v1/items", "requests": 1, "items_served": 2},
    {"endpoint": "/v1/items/{id}", "requests": 1, "items_served": 1},
    {"endpoint": "/v1/search", "requests": 2, "items_served": 2}
  ],
  "requests": 9,
  "items_served": 15,
  "resets_at": "2026-12-01T00:00:00.000000Z",
  "quota": 45000,
  "remaining": 44996,
  "unlimited": false,
  "customer": "vg",
  "plan": "starter",
  "key_id": 1,
  "history": {"url": "/v1/usage/history", "months_default": 6, "months_max": 12}
}

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

Failures

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