Skip to the page
Docs menu

Docs API reference

Usage

Metering.

Usage for a month#

GET/v1/usage

Billable totals for a period.

Keys: secret key; restricted key with usage:read.

Parameters

FieldDescription
periodstring, queryMonth as YYYY-MM. Defaults to the current month.

Request

TypeScript
const result = await timbereye.usage.retrieve()
curl
curl https://api.timbereye.com/v1/usage \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye usage get --json

Response

JSON
// 200
{
  "object": "usage",
  "livemode": true,
  "period": "2027-02",
  "refined_m3": 1284.6,
  "photos": 37,
  "commitment_m3": 2000
}
Errors
StatusWhen
400invalid_request_error: the request was malformed or a field was invalid.
401authentication_error: missing, malformed, expired or revoked key.
403permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you.
404invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404.
429rate_limit_error: slow down and retry after the Retry-After delay.
500api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key.

List usage records#

GET/v1/usage/records

The individual metered results behind the totals, newest first.

Keys: secret key; restricted key with usage:read.

Parameters

FieldDescription
periodstring, queryOnly this month, YYYY-MM.
limitinteger, queryPage size, 1 to 100.
starting_afterstring, queryOpaque cursor: pass the next_cursor of the previous page. Results are ordered by (created_at, id).
expand[]array of string, queryReplace an id field with the full object, e.g. expand[]=origin_place. Allowed values are listed on each resource.

Request

TypeScript
for await (const record of timbereye.usage.listRecords()) {
    // every page, one at a time
}
curl
curl https://api.timbereye.com/v1/usage/records \
  -H "Authorization: Bearer $TIMBEREYE_SECRET_KEY"
CLI
timbereye usage records --json

Response

JSON
// 200
{
  "object": "list",
  "data": [
    {
      "id": "ur_4Tz7Kb",
      "object": "usage_record",
      "livemode": true,
      "item_id": "itm_5Lw2Nc",
      "scan_id": "scn_9a2Lk",
      "unit": "refined_m3",
      "quantity": 1.32,
      "rule": "jas",
      "period": "2027-02",
      "voided_at": null,
      "created_at": "2027-02-03T14:40:52Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
Errors
StatusWhen
400invalid_request_error: the request was malformed or a field was invalid.
401authentication_error: missing, malformed, expired or revoked key.
403permission_error: the key lacks the scope, the capture token is limited to other groups, or the resource is read-only to you.
404invalid_request_error, resource_missing: no such object. Objects in another account are also reported as 404.
429rate_limit_error: slow down and retry after the Retry-After delay.
500api_error: something went wrong on our side. Safe to retry with the same Idempotency-Key.