Usage Metrics API

Notes

  • Only use the Usage Metrics API if you do not receive invoices. If you're a customer receiving invoices, use the invoices API instead.

Limitations

  • /usage-metrics API returns data for a maximum period of three months at a time.

Get information on billing usage metrics.

Data model

customer_idstringAlphanumeric string identifying the customer. Read-only.
detailsarray
end_timestringDate and time (in ISO 8601 format) for termination point of a billing cycle, signifying the end of charges for a service or subscription.
metaobjectPagination metadata.
start_timestringDate and time (in ISO 8601 format) for initiation point of a billing cycle, signifying the start of charges for a service or subscription.
unitstringThe unit for the usage as shown on an invoice. If there is no explicit unit, this field will be "unit" (e.g., a request with product_id of 'cdn_usage' and usage_type of 'North America Requests' has no unit, and will return "unit").
usage_typestringThe usage type identifier for the usage. This is a single, billable metric for the product.
namestringFull name of the product usage type as it might appear on a customer's invoice.
product_idstringThe product identifier associated with the usage type. This corresponds to a Fastly product offering.
limitintegerThe number of invoices included in the response.
next_cursorstringThe token used to request the next set of results.
sortstringThe sort order of the invoices in the response. [Default billing_start_date]
totalintegerTotal number of records available on the backend.
last_updated_atstringThe date when the usage metric was last updated.
monthstringThe year and month of the usage element.
quantitynumberThe quantity of the usage for the product.
raw_quantitynumberThe raw units measured for the product.
regionstringThe geographical area applicable for regionally based products.

Endpoints

Retrieve service-level usage metrics for a product

GET/billing/v3/service-usage-metrics

Get monthly usage metrics

GET/billing/v3/usage-metrics