Skip to main content
GET
Get a cluster's cost projection

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-ankra-organisation-id
string

PAT organisation override.

Path Parameters

cluster_id
string<uuid>
required

Response

Successful response

What one object of the organisation costs now, over the last 30 days and so far this month, read from the same snapshots and staleness window as the fleet summary. A cluster-based object (a cluster, a credential) costs its clusters' run rate, idle capacity included; a namespace-based object (a namespace, a stack, an application) costs its namespaces' allocations and has no idle share. Nothing unknown reads as zero. An application, a credential or a project is read on the clusters the caller may read only; scope.partial says when that left clusters out, so the figure is a floor of the object's.

kind
enum<string>
required
Available options:
cluster,
namespace,
stack,
application,
credential,
project
object
ObjectCostSubject · object
required
currency
string
required

The caller's display currency; every *_cents figure is in its minor units.

priced
boolean
required

At least one cluster behind the object contributed a figure. False leaves every figure null and names why in unpriced_reason.

unpriced_reason
string | null
required
monthly_cents
integer | null
required

The run rate at the latest snapshot inside the window, times 730 hours.

idle_pct
number | null
required

The share of the run rate idle capacity accounts for; cluster-based objects only.

share_of_fleet_pct
number | null
required

monthly_cents over the fleet's run rate in the same window; null when either is unknown or the fleet is zero. The fleet is the organisation's, except for a token pinned to a project or a member limited to projects, whose fleet is that project's; either is cut to the clusters the caller may read when their cluster read is narrowed: exactly what their own fleet summary reads.

confidence
string | null
required

The lowest confidence among the snapshots the figure is read from: high, medium or low.

coverage_incomplete
boolean | null
required

The figure is a floor: a node or billed resource of a contributing cluster could not be priced, or a cluster behind the object contributed no figure (clusters names which).

open_waste
ObjectCostWaste · object
required

The open cloud waste attributed to the object. Waste is found per cloud resource, so only a cluster, a credential or a project (through its clusters) carries it; available false names why it is not read, which is unknown, not none.

trend_30d
ObjectCostDay · object[]
required

The object's daily spend over the last 30 UTC days, oldest first: the cents it cost each day, not a run rate like monthly_cents. The day the read falls in is still metering and is marked partial, so it is never comparable to a whole day. A project's days are what was metered under the project's stamp, whichever cluster was metered: a cluster that moved out or was deleted keeps its days here, a cluster that moved in brings none of its days under another project, and each day's clusters_total is the clusters behind the project that day.

month_to_date_cents
integer | null
required

What the object has spent in the UTC calendar month of trend_30d's last day, up to the read. Read over the whole month, so the 31st of a month has one even though trend_30d covers 30 days. Null when no hour of the month was metered: unknown, not zero. For a cluster, a namespace, a stack or an application it is the same hourly figures trend_30d's days sum, over every hour of the month metered so far (the day still metering included), summed unrounded and rounded once. For a credential it is the credential's by_credential figure in the fleet summary, over the fleet the reader's share_of_fleet_pct divides by: the month of each metered cluster on it now, plus what a cluster deleted this month, or a live one whose metering stalled, spent under it. Spend on month rows written before the credential stamp existed is the provider's unattributed spend, in no credential's month, and a reader confined to a project reads the project's part of each cluster's month, as by_project does. A credential's month is therefore not the sum of trend_30d's days. For a project it is what was spent under the project's stamp this month, whichever cluster spent it: a cluster deleted this month, or moved to another project after spending under this one, keeps what it spent here, and a cluster that moved in brings none of what it spent before. It equals the project's by_project figure in the fleet summary. trend_30d's days read the same stamp, so a cluster's money is in both or in neither; the month prices an hour at its latest metering pass and a day at the mean of its passes, so the month is not the days added up to the cent.

month_to_date_days_elapsed
integer
required

How many UTC days of that month had begun at the read, the day still metering included.

Required range: 0 <= x <= 31
month_to_date_days_metered
integer
required

How many of those days month_to_date_cents covers in full: an ended day on which every cluster behind the object was metered for all 24 hours, plus the day still metering, which counts as metered so far rather than as a gap. That day is not counted while the node inventory of a cluster behind the object is stale: nothing is metering that cluster, so what it costs today is unknown. Fewer than month_to_date_days_elapsed says some of the month is not in the figure. 0 for an object with no cluster behind it. For a project a day is counted against the clusters behind it that day, as trend_30d's clusters_total says: the ones metered under the project's stamp that day, and the ones it holds now that were not metered under another project that day, so one it holds now that nothing metered is a gap. A project that holds no cluster now therefore counts the whole days its moved or deleted clusters were metered under it, and not today.

Required range: 0 <= x <= 31
month_hours
MonthHours · object | null
required

month_to_date_cents counted in hours rather than whole days: the hours of the month that elapsed since each cluster behind the object was first priced, against the ones a metering pass priced, summed over those clusters. A day with one missed hour is a whole gap in month_to_date_days_metered and one hour of 24 here. Null when it cannot be counted the way the figure was summed: for a project or a credential, whose month sums the month rows stamped with it while a cluster's hours are counted for the cluster whatever it was stamped with, for an object with no cluster behind it, and when any cluster behind it was never priced.

clusters
ObjectCostCluster · object[]
required
namespaces
ObjectCostNamespace · object[]
required

The namespaces behind a namespace-based object; empty for a cluster-based one.

snapshot_stale_after_hours
integer
required

The window a snapshot counts in.

generated_at
string<date-time> | null
required

When the newest cost snapshot behind the figure was computed (RFC 3339, UTC): the latest snapshot of a cluster that contributed to it, so a reader can say how fresh the figure is rather than when it asked. Null when no cluster contributed.

change
ApplicationCostChange · object | null
required

Why an application's cost moved over the comparison its cost card makes: the first seven days of the 30-day trend against the last seven complete ones, each scaled to a month, both fully metered. A cause is named only when the platform can tie the movement to an event it recorded and the event's size agrees with what moved; otherwise the state says the movement is unexplained (every source read, nothing fits) or unknown (a source could not be read or does not reach back far enough), never a guess.

scope
CostReadScope · object
required

What a fleet cost read covered (ADR 0022): the project it read, or the whole organisation, and whether the caller's cluster permissions hid clusters from it.