Query Account Usage (Version 2, Alpha, Restricted)
Returns cost and usage data for a single Cloudflare account, aligned with the FinOps FOCUS v1.3 Cost and Usage dataset specification.
This is the filterable counterpart to GET on the same path. It is a
read-only operation and requires only the #billing:read permission;
POST is used so that filter criteria can be supplied in a request body
rather than in the query string.
Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost.
Note: Cost and pricing fields are populated only when Metric
is cost; otherwise they are absent from responses.
The request body is optional. When it is omitted, or when TimePeriod
is omitted, the range defaults to the start of the current month through
today. The maximum date range is 31 days.
Filters of different kinds are combined with AND. Values within one tag filter are combined with OR. Filter values that do not match usage produce an empty result set.
Results can be grouped by up to two groups, in any combination of
dimension keys and resource-tag keys. Tag groups are returned in the
Tags field. Usage without a requested tag remains in an untagged
group, with that key omitted from Tags.
Requests that use tag filtering or tag grouping return HTTP 400 when the underlying usage data source does not support tags.
Requests that use dimension grouping return HTTP 400 when the underlying usage data source does not support dimensions.
Granularity is optional. When it is omitted, the response is as
described above. With DAILY, each record covers one day. With
PERIOD, each record covers the whole time period:
ChargePeriodStart is the first day of the period and
ChargePeriodEnd is the day after its last day. For usage,
ConsumedQuantity is the sum of the daily quantities in the bucket.
When Granularity is set and Metric is cost, each record is one
billable metric for one bucket. PricingQuantity and BilledCost are
summed across pricing tiers, so unit prices and the list and
contracted costs derived from them are absent. Only cost held in US
dollars is summed, so a total can be lower than the sum of the cost
records returned without Granularity for the same range when that
range also holds cost in another credit type.
Requests for usage that use PERIOD granularity return HTTP 400
when the underlying usage data source does not support it.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Query Account Usage (Version 2, Alpha, Restricted)
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/billable/usage \
-X POST \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": [
{
"ChargeCategory": "Usage",
"ChargeDescription": "Workers Standard Requests",
"ChargeFrequency": "Usage-Based",
"ChargePeriodEnd": "2025-05-02T00:00:00Z",
"ChargePeriodStart": "2025-05-01T00:00:00Z",
"ConsumedUnit": "Requests",
"HostProviderName": "Cloudflare",
"InvoiceIssuerName": "Cloudflare",
"ServiceProviderName": "Cloudflare",
"x_BillableMetricId": "workers_standard_requests",
"BilledCost": 0,
"BillingAccountId": "023e105f4ecef8ad9ca31a8372d0c353",
"BillingAccountName": "My Account",
"BillingCurrency": "USD",
"BillingPeriodEnd": "2025-06-01T00:00:00Z",
"BillingPeriodStart": "2025-05-01T00:00:00Z",
"ChargeClass": "Correction",
"ConsumedQuantity": 150000,
"ContractedCost": 0.75,
"ContractedUnitPrice": 0.000005,
"EffectiveCost": 0,
"ListCost": 0.75,
"ListUnitPrice": 0.000005,
"PricingQuantity": 150000,
"PricingUnit": "Requests",
"RegionId": "EEUR",
"RegionName": "Eastern Europe",
"SubAccountId": "c9bd752d-9ca8-411d-b804-be44a758057f",
"SubAccountName": "My Subscription",
"Tags": {
"team": "fintech"
},
"x_BillableMetricName": "Workers Standard Requests",
"x_ProductCategoryName": "Developer",
"x_ProductFamilyId": "workers",
"x_ProductFamilyName": "Workers",
"x_ZoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"x_ZoneName": "example.com"
}
],
"success": true
}Returns Examples
{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": [
{
"ChargeCategory": "Usage",
"ChargeDescription": "Workers Standard Requests",
"ChargeFrequency": "Usage-Based",
"ChargePeriodEnd": "2025-05-02T00:00:00Z",
"ChargePeriodStart": "2025-05-01T00:00:00Z",
"ConsumedUnit": "Requests",
"HostProviderName": "Cloudflare",
"InvoiceIssuerName": "Cloudflare",
"ServiceProviderName": "Cloudflare",
"x_BillableMetricId": "workers_standard_requests",
"BilledCost": 0,
"BillingAccountId": "023e105f4ecef8ad9ca31a8372d0c353",
"BillingAccountName": "My Account",
"BillingCurrency": "USD",
"BillingPeriodEnd": "2025-06-01T00:00:00Z",
"BillingPeriodStart": "2025-05-01T00:00:00Z",
"ChargeClass": "Correction",
"ConsumedQuantity": 150000,
"ContractedCost": 0.75,
"ContractedUnitPrice": 0.000005,
"EffectiveCost": 0,
"ListCost": 0.75,
"ListUnitPrice": 0.000005,
"PricingQuantity": 150000,
"PricingUnit": "Requests",
"RegionId": "EEUR",
"RegionName": "Eastern Europe",
"SubAccountId": "c9bd752d-9ca8-411d-b804-be44a758057f",
"SubAccountName": "My Subscription",
"Tags": {
"team": "fintech"
},
"x_BillableMetricName": "Workers Standard Requests",
"x_ProductCategoryName": "Developer",
"x_ProductFamilyId": "workers",
"x_ProductFamilyName": "Workers",
"x_ZoneId": "023e105f4ecef8ad9ca31a8372d0c353",
"x_ZoneName": "example.com"
}
],
"success": true
}