Common Bill Format (CBF) Reference
Common Bill Format (CBF) is CloudZero's standard format for ingesting cost data from any source. When you connect a Custom Cost Data Source, your Adaptor converts your source data into CBF before sending it to CloudZero.
CBF works with both connection methods:
- REST API: Send CBF data as JSON objects in the request body.
- S3 Bucket: Write CBF data as gzipped CSV files (
.csv.gz), encoded in UTF-8.
Mapping your data to CBF
Each record in your cost data maps to a set of CBF fields, organized into four categories:
| Category | When to use |
|---|---|
| Required | Every record needs a cost amount, a date, and a resource identifier (when using tags). |
| Recommended | Account, service, line item type, and usage data give you richer breakdowns across CloudZero. |
| Optional cost | Use when your source distinguishes between cost types like amortized, discounted, or on-demand. |
| Optional dimension | Add context like region, tags, Kubernetes metadata, and cloud provider. |
Field reference
| CBF column | Type | Status | Description |
|---|---|---|---|
cost/cost | number | Required | The cost for this line item. Can be negative for discounts or credits. Example: 12, -20 |
resource/id | string | Required | Uniquely identifies the resource charged (required only when tags are included). See details. Example: function/my-lambda |
time/usage_start | datetime | Required | The hour during which the usage applies (aligned to start of hour, UTC). Example: 2024-08-16T13:00:00Z |
lineitem/type | string | Recommended | Category of line item. Defaults to Usage.Example: Usage, Tax, Discount |
resource/account | string | Recommended | The most specific account or project for this resource. Example: prod-001 |
resource/service | string | Recommended | Service category the resource belongs to. Example: Compute, Storage |
usage/amount | number | Recommended | Amount consumed or used (for example, GB stored, seconds executed, credits consumed). Example: 100, 3600 |
usage/units | string | Recommended | Units for usage/amount (relevant only when usage/amount is populated). Example: GB, seconds |
action/operation | string | Optional | Action performed on the resource that generated the charge. Example: RunInstances |
action/usage_type | string | Optional | Subdivision of resource/usage_family.Example: USW2-BoxUsage:m5.xlarge |
bill/invoice_id | string | Optional | Invoice identifier. Do not populate until the invoice is closed. Example: INV-2024-08 |
cost/amortized_cost | number | Optional | Cost after committed use (for example, Reserved Instances, Savings Plans) amortization. See details. Example: 38 |
cost/discounted_amortized_cost | number | Optional | Cost after both discounts and committed use amortization. Example: 34 |
cost/discounted_cost | number | Optional | Cost after discounts, credits, or negotiated pricing. Example: 8 |
cost/on_demand_cost | number | Optional | Cost without any reductions applied. Useful for calculating savings rates. Example: 24 |
k8s/cluster | string | Optional | Kubernetes cluster associated with the resource. Example: my-cluster |
k8s/deployment | string | Optional | Kubernetes deployment associated with the resource. Example: web-app |
k8s/labels | string | Optional | Kubernetes labels associated with the resource (JSON object). Example: {"app": "frontend"} |
k8s/namespace | string | Optional | Kubernetes namespace associated with the resource. Example: default |
lineitem/cloud_provider | string | Optional | Cloud provider for this line item (for multi-provider CBF files). Example: AWS, Azure, Anthropic |
lineitem/description | string | Optional | Additional line item description. Example: m5.xlarge on-demand |
resource/region | string | Optional | Region (default: no-region, free-form). Do not use global.Example: us-east-1, eastus |
resource/tag:<key> | string | Optional | Custom resource attributes. Requires resource/id. See tag rules.Example: resource/tag:team = platform |
resource/tags | string | Optional | Alternative to resource/tag:<key>. All tags as a single JSON object with string keys and values. Requires resource/id. Pick one approach per file; if both are present, resource/tags takes precedence for overlapping keys.Example: {"team": "Alpha", "environment": "production"} |
resource/usage_family | string | Optional | Subdivision of resource/service.Example: EC2 - Other, Networking |
time/usage_end | datetime | Optional | End of usage timespan (all charges are treated as occurring at time/usage_start).Example: 2024-08-16T14:00:00Z |
action/account | string | Deprecated | Use resource/account instead. |
action/region | string | Deprecated | Use resource/region instead. |
Field details
The following fields have specific rules or behaviors beyond what the field reference table covers.
lineitem/type
lineitem/typeSupported values for lineitem/type:
| Value | Description |
|---|---|
Adjustment | An alteration to the bill to correct an error or rounding issue. |
CommittedUsePurchase | An upfront fee for a committed use subscription. Committed use covers any upfront or recurring payment that locks in a lower rate (for example, Reserved Instances, Savings Plans). The amortized_cost for this line item should be zero. Time columns should represent the span of the charge. |
CommittedUseRecurringFee | A recurring fee for an active committed use subscription (for example, the monthly charge for a Reserved Instance). |
CommittedUseVacancy | Unused capacity from a committed use subscription (for example, a Reserved Instance with no matching usage). |
Credit | A negative value not associated with a specific Usage line item (for example, adjustments, refunds, rounding corrections). |
Discount | A negative value associated with a Usage line item. Time, resource, and action fields should match the applicable Usage line item. Set discounted_cost to zero if the discount is fully accounted for in the discounted_cost of other Usage line items. You must still include discounted_cost even if the value is zero. |
Fee | A positive charge for which no other line item type applies. |
Purchase | A one-time purchase or non-usage subscription (for example, marketplace software). Time columns should represent the span of applicability or the time of purchase. |
Support | Charges for support or human services. Time columns should specify the start and end of the support contract. |
Tax | Tax charges. Populate time, resource, and action fields only if the tax relates to specific Usage charges. Otherwise, leave those fields blank. |
Usage | A charge for the use of a cloud resource. This is the default if lineitem/type is not provided. The Real Cost cost type includes only Usage line items. |
resource/id
resource/idUniquely identifies the resource being charged. Required when resource/tag:<key> or resource/tags columns are included. Tags are time-independent, so CloudZero uses only the most recent set of tags for each unique resource ID.
CloudZero splits resource/id on the first colon (:) or forward slash (/) to extract two parts:
Example resource/id | Resource type | Resource cloud local ID | Dropped |
|---|---|---|---|
function/my-lambda-function | function | my-lambda-function | — |
a:b:c | a | b | c |
a/b/c/d/e | a | b | c, d, e |
Avoid using colons and forward slashes in resource/id values except to separate the type and name. Additional segments after the first separator are dropped.
resource/tag:<key>
resource/tag:<key>Custom attributes associated with a resource.
- Requires
resource/idto be populated. - The
<key>is case sensitive and can contain letters, numbers, and the characters_ . : / = + - @. No spaces, tabs, or returns.- Valid:
resource/tag:team,resource/tag:Product-Type - Invalid:
resource/tag:Team Name,resource/tag:Product&Dev
- Valid:
- Tags appear as Tag Dimensions in CloudZero and can be used to filter or group costs.
- You can include as many unique
resource/tag:<key>columns as needed. - Only one value is stored per
resource/tag:<key>perresource/id:- If multiple values exist, the value with the latest
time/usage_startis used. - If all instances have identical
time/usage_startdates, one is selected arbitrarily.
- If multiple values exist, the value with the latest
- The latest value is retroactively applied to all historical data in CloudZero for that
resource/id.
Alternatively, you can send all tags for a record as a single JSON object using the resource/tags column instead of individual resource/tag:<key> columns. Pick one approach per file. The same key rules apply.
{"team": "Alpha", "environment": "production"}
Cost columns
If you leave an optional cost column blank, CloudZero fills it using a fallback chain. A value of 0 is not treated as blank and is used as-is.
discounted_amortized_cost→amortized_cost→discounted_cost→costamortized_cost→costdiscounted_cost→coston_demand_cost→cost
The total value across all line items for cost, discounted_cost, amortized_cost, and discounted_amortized_cost should be the same. Each column represents a different way of distributing the same charges, not the addition or removal of charges. CloudZero does not reject mismatches, but inconsistent totals produce inaccurate cost breakdowns.
cost/amortized_cost
cost/amortized_costAmortization spreads an upfront payment across the resources and time periods that benefit from it. The cost/amortized_cost field represents the effective cost after committed use purchases (for example, Reserved Instances, Savings Plans, GCP CUDs) are amortized across the Usage line items they apply to.
CloudZero does not automatically amortize based on start and stop dates you send. The cost is applied on the start date.
Examples
These examples build on each other, starting with a basic bill and progressively adding cost columns to show how discounts and committed use purchases are represented.
Basic bill
A company purchases Compute from "Simple Cloud." They made an upfront committed use purchase that lowered the hourly rate by 50%. They also received a SpecialCompute discount for using a certain instance type, and an MVP Discount. The cost/cost column totals the bill for March: $105.30.
| lineitem/type | resource/service | resource/id | time/usage_start | cost/cost |
|---|---|---|---|---|
| Usage | Compute | instance-0000 | 2022-03-16T13:00:00Z | 12 |
| Usage | Compute | instance-0001 | 2022-03-16T13:00:00Z | 20 |
| Usage | Compute | instance-0002 | 2022-03-16T13:00:00Z | 15.3 |
| Purchase | CommittedUse | commit-111-222-333 | 2022-03-01T00:00:00Z | 90 |
| Discount | SpecialCompute | special-01010101 | 2022-03-16T13:00:00Z | -12 |
| Discount | MVPDiscount | mvp-aaa-12345 | 2022-03-01T00:00:00Z | -20 |
Adding discounted cost
Adding cost/discounted_cost distributes the SpecialCompute discount across the individual instances. The SpecialCompute discount line item is zeroed out because it is already accounted for in the instance costs. The MVPDiscount is kept separate because it is unrelated to the Compute instances.
| lineitem/type | resource/service | resource/id | time/usage_start | cost/cost | cost/discounted_cost |
|---|---|---|---|---|---|
| Usage | Compute | instance-0000 | 2022-03-16T13:00:00Z | 12 | 8 |
| Usage | Compute | instance-0001 | 2022-03-16T13:00:00Z | 20 | 16 |
| Usage | Compute | instance-0002 | 2022-03-16T13:00:00Z | 15.3 | 11.3 |
| Purchase | CommittedUse | commit-111-222-333 | 2022-03-01T00:00:00Z | 90 | 90 |
| Discount | SpecialCompute | special-01010101 | 2022-03-16T13:00:00Z | -12 | 0 |
| Discount | MVPDiscount | mvp-aaa-12345 | 2022-03-01T00:00:00Z | -20 | -20 |
Adding amortized cost
Adding cost/amortized_cost distributes the committed use purchase across the Compute instances it applies to. The purchase line item is zeroed out. The SpecialCompute discount is also zeroed out because the discount is already reflected in the reduced amortized costs of the instances. The total across cost/amortized_cost is $105.30.
| lineitem/type | resource/service | resource/id | time/usage_start | cost/cost | cost/discounted_cost | cost/amortized_cost |
|---|---|---|---|---|---|---|
| Usage | Compute | instance-0000 | 2022-03-16T13:00:00Z | 12 | 8 | 38 |
| Usage | Compute | instance-0001 | 2022-03-16T13:00:00Z | 20 | 16 | 46 |
| Usage | Compute | instance-0002 | 2022-03-16T13:00:00Z | 15.3 | 11.3 | 41.3 |
| Purchase | CommittedUse | commit-111-222-333 | 2022-03-01T00:00:00Z | 90 | 90 | 0 |
| Discount | SpecialCompute | special-01010101 | 2022-03-16T13:00:00Z | -12 | 0 | 0 |
| Discount | MVPDiscount | mvp-aaa-12345 | 2022-03-01T00:00:00Z | -20 | -20 | -20 |
Adding Kubernetes columns
Adding Kubernetes columns provides context about which clusters, namespaces, and deployments are associated with each charge.
| lineitem/type | resource/service | resource/id | time/usage_start | k8s/cluster | k8s/namespace | k8s/deployment | k8s/labels | cost/cost |
|---|---|---|---|---|---|---|---|---|
| Usage | Compute | instance-0000 | 2022-03-16T13:00:00Z | my-cluster | default | web-app | {"app": "frontend", "env": "production"} | 12 |
| Usage | Compute | instance-0001 | 2022-03-16T13:00:00Z | my-cluster | default | web-app | {"app": "frontend", "env": "production"} | 20 |
| Usage | Compute | instance-0002 | 2022-03-16T13:00:00Z | my-cluster | default | worker-app | {"app": "backend", "env": "production"} | 15.3 |
Have questions or feedback? Reach out to your account manager.

