> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud Cost

> Estimated cloud spend for every cluster and your whole fleet - compute, storage, network, and per-namespace allocation.

Cloud Cost gives you an estimated view of what your clusters cost to run, without wiring up a separate cost tool. Ankra combines the live node and volume inventory it already syncs from your cluster with public cloud pricing to produce per-cluster and fleet-wide estimates, broken down by category and allocated back to namespaces and stacks.

<Note>
  All figures are **estimates**, derived from on-demand and spot pricing for the resources Ankra can see. They are designed for trend-watching, right-sizing, and chargeback - not for reconciling a cloud invoice to the cent.
</Note>

***

## How it works

To estimate cost for a cluster, Ankra needs three things:

1. A **cloud credential** for the cluster's provider (for example AWS or GCP), so it can resolve instance and volume pricing. See [Credentials](/integrations/credentials).
2. The cluster to be **online**, so the agent can sync the current nodes and volumes.
3. **Pricing** for the region and instance types in use.

A background inventory sync keeps the node and volume picture current per provider; cost is recomputed from that inventory plus your pricing settings.

### Readiness states

The per-cluster cost view reports a readiness state so you always know why an estimate is or isn't available:

| State                  | Meaning                                                                 |
| ---------------------- | ----------------------------------------------------------------------- |
| `ready`                | A cost estimate is available                                            |
| `no_credential`        | No cloud credential is attached for this provider                       |
| `unsupported_provider` | The cluster's provider isn't supported for cost estimation              |
| `cluster_offline`      | The cluster is offline, so inventory can't be synced                    |
| `awaiting_nodes`       | Waiting for the first node inventory sync                               |
| `awaiting_pricing`     | Nodes are known, pricing is still resolving                             |
| `estimate_pending`     | Inventory and pricing are present; the first estimate is being computed |

***

## Per-cluster cost

Open a cluster and select the **Cost** view to see its estimate. It includes:

* **Summary** - hourly cost, estimated monthly cost, month-to-date, and a projected month-end total, with a confidence level.
* **Breakdown** - compute split into on-demand and spot, plus storage, network, and control-plane cost, along with idle and unallocated portions.
* **Coverage** - how many nodes and volumes were priced. If some couldn't be priced, the estimate is flagged as `coverage_incomplete` so you know it understates the true figure.
* **Per-namespace allocation** - cost allocated to each namespace (and the owning stack, where known) by CPU and memory share, so you can attribute spend to teams or workloads.
* **Trend** - a daily series of the monthly cost estimate so you can spot changes over time.

```bash theme={null}
GET /org/clusters/{cluster_id}/cost
```

***

## Fleet summary

The organisation-wide rollup aggregates every cluster's estimate into a single number, with breakdowns by provider and a list of your top-spending clusters:

```bash theme={null}
GET /org/cloud-cost/summary
```

It returns estimated monthly cost, month-to-date, and projected month-end totals - in your configured display currency - both overall, per provider, and for the top clusters. This is the same rollup shown on the [Dashboard](/platform/dashboard).

***

## Settings

Organisation admins can tune how cost is displayed and estimated under cost settings:

| Setting                           | Description                                                                                            |
| --------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `currency`                        | Display currency: `usd`, `eur`, or `gbp`                                                               |
| `effective_discount_pct`          | A flat discount (0-100) applied to list pricing, to approximate committed-use or enterprise agreements |
| `include_network_egress_estimate` | Whether to add an estimated network egress component                                                   |

```bash theme={null}
GET /org/cloud-cost/settings
PUT /org/cloud-cost/settings   # organisation admins only
```

<Warning>
  Only organisation admins can change cost settings. The discount must be between 0 and 100, and the currency must be one of `usd`, `eur`, or `gbp`.
</Warning>

***

## Prerequisites checklist

<Steps>
  <Step title="Attach a cloud credential">
    Add an AWS or GCP credential for the cluster's provider under [Credentials](/integrations/credentials).
  </Step>

  <Step title="Bring the cluster online">
    Ensure the [agent](/concepts/cluster-agent) is connected so node and volume inventory can sync.
  </Step>

  <Step title="Set your currency and discount">
    As an org admin, set the display currency and any committed-use discount in cost settings.
  </Step>

  <Step title="Read the estimate">
    Open the cluster's Cost view, or the fleet rollup on the Dashboard.
  </Step>
</Steps>
