usage
Creates, updates, deletes, gets or lists a usage resource.
Overview
| Name | usage |
| Type | Resource |
| Id | cloudflare.billing.usage |
Fields
The following fields are returned by SELECT queries:
- list
Indicates PayGo account usage data was successfully retrieved.
| Name | Datatype | Description |
|---|---|---|
BillingCurrency | string | Specifies the billing currency code (ISO 4217). (example: USD) |
BillingPeriodStart | string (date-time) | Indicates the start of the billing period. (example: 2025-02-01T00:00:00Z) |
ChargePeriodEnd | string (date-time) | Indicates the end of the charge period. (example: 2025-02-02T00:00:00Z) |
ChargePeriodStart | string (date-time) | Indicates the start of the charge period. (example: 2025-02-01T00:00:00Z) |
ConsumedQuantity | number | Specifies the quantity consumed during this charge period. |
ConsumedUnit | string | Specifies the unit of measurement for consumed quantity. (example: Requests) |
ContractedCost | number | Specifies the cost for this charge period in the billing currency. |
CumulatedContractedCost | number | Specifies the cumulated cost for the billing period in the billing currency. |
CumulatedPricingQuantity | integer | Specifies the cumulated pricing quantity for the billing period. |
PricingQuantity | integer | Specifies the pricing quantity for this charge period. |
ServiceName | string | Identifies the Cloudflare service. (example: Workers Standard) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id | from, to | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
from | string (date) | Defines the start date for the usage query (e.g., 2025-02-01). |
to | string (date) | Defines the end date for the usage query (e.g., 2025-03-01). |
SELECT examples
- list
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 }}'
;