slice_costs
Slice cloud costs by custom dimensions, filters, and date ranges. Returns cost data and chart cards for dashboard pinning.
Instructions
Slice cloud cost any way you want. This is the flexible, moldable cost query:
group and filter by ANY combination of dimensions, over any date range, instead
of a fixed set of canned reports. Returns both the numbers and a card describing
how to chart them (which the UI can render and pin to the dashboard).
Dimensions (group by, up to 3): ServiceName, ServiceCategory, ProviderName, RegionId, RegionName, SubAccountId, SubAccountName, ResourceId, ResourceName, ResourceType, ChargeCategory, ChargeDescription, CommitmentDiscountId, CommitmentDiscountType, plus "date" (a time series, use granularity) and "Tags[]" for any tag (e.g. "Tags[team]"). For line-item detail (AWS only, needs CUR + Athena set up): "usage_type", "instance_type", "resource_id" — using any of these auto-routes the query to the CUR pushdown.
filters / exclusions: each is {dimension, op, values}. op is one of eq, in, neq, not_in, contains, regex. filters keep matching rows; exclusions drop matching rows. Example "EC2 by region last 90 days, excluding Savings Plan credits": dimensions=["RegionId"], filters=[{"dimension":"ServiceName","op":"eq","values":["Amazon EC2"]}], exclusions=[{"dimension":"ChargeCategory","op":"in","values":["Credit"]}], metric="EffectiveCost"
metric: BilledCost | EffectiveCost (amortized, default) | ListCost. granularity: TOTAL | DAILY | MONTHLY (only matters when "date" is a dimension). order_by: "metric" (default, descending) or a dimension name. start_date / end_date: YYYY-MM-DD (default last 30 days). provider: aws|azure|gcp (default all). via: "auto" (default; CUR only when a line-item dimension is requested), "focus", or "cur".
This is read-only: it slices and charts cost data. It never changes anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| via | No | auto | |
| limit | No | ||
| title | No | ||
| metric | No | EffectiveCost | |
| filters | No | ||
| end_date | No | ||
| order_by | No | metric | |
| provider | No | ||
| dimensions | No | ||
| exclusions | No | ||
| start_date | No | ||
| granularity | No | TOTAL |