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).
organization_id is optional in beta but will be required at GA, so send it now to avoid a breaking change.product_namevalues are display names, not stable identifiers, and can change without notice.attributesvary by product. For example,api_key_idandproject_idare only set on inference line items.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Billing month in YYYY-MM format. Defaults to the current month, which returns data through yesterday (daily) or the last completed hour (hourly).
^\d{4}-(0[1-9]|1[0-2])$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.
1Time window size for rows. 'hour' returns ~24x more rows than 'day'.
day, hour Maximum number of time windows per page (max 1000).
1 <= x <= 1000Opaque 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
"list"ID of the organization the report belongs to.
Billing month (YYYY-MM).
Start of the earliest time window with usage in the month (UTC, ISO 8601); null when the month has no usage.
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.
"USD"Time windows containing usage line items.
Opaque cursor for the next page; null when this is the last page.