Docs / Read Usage
Read Usage
Read Usage
GET/v1/account/usage
- Auth
- cookie session
- Cache-Control
no-store- Source of truth
clients/openapi.jsonanddocs/API.md§12
The same numbers /v1/usage gives a key, for one customer in one UTC month. items_served and requests are traffic (every item in every served response, re-polls included); quota is the sum of monthly_quota over the customer's live keys, and 0 means unlimited.
billable_itemsis the figure the quota is enforced against: distinct items this month, plus anything the live meter has not flushed yet. It is NOTitems_served— 12 re-polls of one item are 12 items of traffic and one billable item, so a gauge built from traffic reads "1,200% used" on a key that has spent one item of a thousand.?month=YYYY-MMselects another month; the default is the current UTC month.- A malformed
monthis400 month must be a YYYY-MM string. 401 {"detail":"not_signed_in"}as onGET /v1/account.
Description: docs/API.md §12
Parameters
| Name | In | Required | Type | Example | Notes |
|---|---|---|---|---|---|
month | query | no | string | 2026-11 | YYYY-MM; defaults to the current UTC month. |
Example request
curl -sS \
'https://vg.tempproject.online/v1/account/usage?month=2026-11' \
-H "Cookie: cbn_session=$NEWS_SESSION"import json
import os
import urllib.request
URL = "https://vg.tempproject.online/v1/account/usage?month=2026-11"
def call() -> dict:
req = urllib.request.Request(URL, headers={
"Cookie": f"cbn_session={os.environ['NEWS_SESSION']}",
})
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])const res = await fetch(
"https://vg.tempproject.online/v1/account/usage?month=2026-11",
{
method: "GET",
headers: {
cookie: `cbn_session=${process.env.NEWS_SESSION}`,
},
},
);
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
{
"month": "2026-11",
"quota": 45000,
"billable_items": 412,
"items_served": 1284,
"requests": 96,
"by_day": [
{"day": "2026-11-10", "requests": 54, "items_served": 684},
{"day": "2026-11-11", "requests": 42, "items_served": 600}
],
"by_endpoint": [
{"endpoint": "/v1/feed/{locale}", "requests": 60, "items_served": 1200},
{"endpoint": "/v1/items/{item_id}", "requests": 36, "items_served": 84}
],
"months_available": ["2026-10", "2026-11"]
}Response example in docs/API.md §12 (GET /v1/account/usage)
Failures
This operation can answer 200, 401, 422. The full envelope for each status, with its body, is on Errors.