Billing

Get billing usage

Returns an organization's billing usage for a month as cost-annotated line items grouped into time windows. Finalized windows are returned through the end of yesterday at daily granularity, or the last completed hour at hourly granularity (UTC).

get/billing/usage

Query parameters

monthstring

Billing month in YYYY-MM format. Defaults to the current month, which returns data through yesterday (daily) or the last completed hour (hourly).

organization_idstring

Organization to report on. Usage is always reported for the organization that owns the API key, so this is optional; supplying an ID that is not that organization returns 403.

granularity'day' | 'hour'

Time window size for rows. 'hour' returns ~24x more rows than 'day'.

limitinteger

Maximum number of time windows per page (max 1000).

afterstring

Opaque cursor from a previous response's next_cursor. Only valid for the month and granularity it was issued for. Current-month data is a moving snapshot: each page reflects data as of its request, so newly completed windows may appear at the end of the sequence.

Response

Billing usage report for the requested month

object'list' required
organization_idstring required

ID of the organization the report belongs to.

billing_periodstring required

Billing month (YYYY-MM).

earliest_window_startstring date-time nullable required

Start of the earliest time window with usage in the month (UTC, ISO 8601); null when the month has no usage.

latest_window_endstring date-time nullable required

Exclusive end of the latest time window with usage in the month (UTC, ISO 8601); null when the month has no usage. Describes the whole month, not the current page.

currency'USD' required
next_cursorstring nullable required

Opaque cursor for the next page; null when this is the last page.

Changes

Changed in 1 of the 14 revisions of this API.1