Skip to main content

usage

Creates, updates, deletes, gets or lists a usage resource.

Overview

Nameusage
TypeResource
Idcloudflare.billing.usage

Fields

The following fields are returned by SELECT queries:

Indicates PayGo account usage data was successfully retrieved.

NameDatatypeDescription
BillingCurrencystringSpecifies the billing currency code (ISO 4217). (example: USD)
BillingPeriodStartstring (date-time)Indicates the start of the billing period. (example: 2025-02-01T00:00:00Z)
ChargePeriodEndstring (date-time)Indicates the end of the charge period. (example: 2025-02-02T00:00:00Z)
ChargePeriodStartstring (date-time)Indicates the start of the charge period. (example: 2025-02-01T00:00:00Z)
ConsumedQuantitynumberSpecifies the quantity consumed during this charge period.
ConsumedUnitstringSpecifies the unit of measurement for consumed quantity. (example: Requests)
ContractedCostnumberSpecifies the cost for this charge period in the billing currency.
CumulatedContractedCostnumberSpecifies the cumulated cost for the billing period in the billing currency.
CumulatedPricingQuantityintegerSpecifies the cumulated pricing quantity for the billing period.
PricingQuantityintegerSpecifies the pricing quantity for this charge period.
ServiceNamestringIdentifies the Cloudflare service. (example: Workers Standard)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_idfrom, toReturns billable usage data for PayGo (self-serve) accounts. When no query parameters are provided, returns usage for the current billing period. This endpoint is currently in alpha and access is restricted to select accounts. While in alpha, the endpoint may get breaking changes.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
fromstring (date)Defines the start date for the usage query (e.g., 2025-02-01).
tostring (date)Defines the end date for the usage query (e.g., 2025-03-01).

SELECT examples

Returns billable usage data for PayGo (self-serve) accounts. When no query parameters are provided, returns usage for the current billing period. This endpoint is currently in alpha and access is restricted to select accounts. While in alpha, the endpoint may get breaking changes.

SELECT
BillingCurrency,
BillingPeriodStart,
ChargePeriodEnd,
ChargePeriodStart,
ConsumedQuantity,
ConsumedUnit,
ContractedCost,
CumulatedContractedCost,
CumulatedPricingQuantity,
PricingQuantity,
ServiceName
FROM cloudflare.billing.usage
WHERE account_id = '{{ account_id }}' -- required
AND from = '{{ from }}'
AND to = '{{ to }}'
;