BillOS v1
Console llms.txt OpenAPI
GET/usage

Your API usage

GET /usage

Requires the businesses scope.

Your key's own request rollups per endpoint: requests and error counts over the window. Days are Asia/Jerusalem calendar days.

Query parameters

NameTypeDescription
daysintegerWindow in days (default 30, max 365).
latencystringSend 0 to skip the latency figures (latency is then null). One of: 0.

Response

200: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
daysintegerrequired
usagearray of objectrequired
dailyarray of objectThe same window as a series: one row per day (Israel time) that had traffic.
latencyobjectResponse times from the request log, which is kept for fewer days than the rollup: the figures cover the last days of the window the log still holds.
latency.countintegerRequests the figures were computed over.
latency.p50integerMedian, ms.
latency.p95integer95th percentile, ms.
latency.maxintegerms
latency.daysintegerThe part of the window the log covers.

Errors: 400, 401, 403, 404, 429. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).

GET /usage
curl -X GET "$BASE/usage?days=&latency=" \
  -H "X-Api-Key: $KEY"
const res = await fetch(`${BASE}/usage`, {
  method: 'GET',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.get(
    f"{BASE}/usage",
    headers={"X-Api-Key": KEY},
)
data = res.json()
Set BASE to https://api.billos.co.il/v1 and KEY to your bk_live_… key, or a bk_test_… key to run it against the sandbox.
Manage your businesses, keys and webhooks in the BillOS Console.