Skip to main content
GET
Cost query

Authorizations

Authorization
string
header
required

Enter "Bearer {token}"

Headers

X-CostGraph-Tenant-ID
string
required

Tenant ID

Query Parameters

period
enum<string>

Cost period; defaults to month_to_date

Available options:
month_to_date,
last_7d,
last_30d,
calendar_month,
custom
month
string

Closed calendar month in YYYY-MM format; required when period=calendar_month

start
string

Window start in RFC3339 format; required when period=custom

end
string

Window end in RFC3339 format; required when period=custom

reporting_currency
string

ISO 4217 code to express every amount in, converted at each day's exchange rate; defaults to the currency most of the selected period's spend was billed in, or USD when none dominates

group_by
string
required

Ordered, comma-separated dimensions to group by; nested into a tree (e.g. provider,region,resource_type). Fixed dimensions: provider, resource_type, service_category, service_subcategory, service, region, availability_zone, resource, sku_id, sku_meter, charge_category, charge_description, pricing_category, pricing_unit, usage_unit, billing_account_id, sub_account, sub_account_type, invoice_id, invoice_issuer, publisher, currency. Tag and virtual-tag keys are also accepted as tag:, and provider extension keys as extension:; those keys are per-tenant or per-provider so they are not enumerable here

stack_by
string

Dimension to stack the time series by; accepts any dimension group_by accepts, including tag: and extension:

layer
enum<string>

Cost layer; defaults to billed. ci returns CI runner job rows, including each job's share of a vendor bill.

Available options:
billed,
allocation,
ci
group_limit
integer

Maximum groups returned per level of the group tree; defaults to 100. Groups beyond the limit are combined into one final entry per level, marked other=true and carrying the folded group count

group_offset
integer

Number of top-level groups to skip, for paging past group_limit; deeper levels are not paged. The trailing other entry counts the groups left after this page

Case-insensitive text matched against the values and names of the grouped dimensions; totals, groups and series cover only matching rows, and totals.searchSharePct gives their share of the unsearched total

format
enum<string>

Response format; defaults to json. csv and xlsx download the full group table as a file

Available options:
json,
csv,
xlsx
include_sub_accounts
boolean

Break every group down by sub-account, returning the top spenders plus a rollup of the rest and, where the group is only partly attributed, the unassigned remainder

filter
string[]

Repeated key:value dimension filter, repeat a key to match any of its values, e.g. filter=provider:aws&filter=provider:gcp. Keys are the same dimensions group_by accepts: provider, resource_type, service_category, service_subcategory, service, region, availability_zone, resource, sku_id, sku_meter, charge_category, charge_description, pricing_category, pricing_unit, usage_unit, billing_account_id, sub_account, sub_account_type, invoice_id, invoice_issuer, publisher, currency, plus per-tenant tag and virtual-tag keys as filter=tag:: and provider extension keys as filter=extension::. Prefix a dimension with has: for rows where it resolves at all, e.g. filter=has:tag:owner, filter=has:extension:x_ProjectId or filter=has:region. Prefix a dimension with no: for rows where it does not resolve, e.g. filter=no:tag:owner or filter=no:region. Prefix a dimension with not: to drop the given values, keeping rows where it does not resolve, repeat it to drop several, e.g. filter=not:provider:aws&filter=not:provider:gcp or filter=not:tag:team:platform; it combines with a plain filter on the same dimension. A filter_= query parameter is equivalent

Response

OK

message
string
required
Example:

"some message"

status
string
required
Example:

"success"

data
object