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

# Analyze costs using API

The Domino Cost Center APIs allow aggregation only by labels of Domino domain objects, not by arbitrary Kubernetes objects, such as clusters.

## Access Cost Center through Domino Cost API

You can use the Domino Cost API to access Cost Center features.

See the [Domino Platform API Reference](/cloud/reference/api/domino-open-api#_cost) documentation for the field options available with Cost Center APIs.

<Note>
  Only [CloudAdmins](/cloud/admin/identity-and-access/manage-users/roles) can use the `/allocation` and `/asset` API paths.
</Note>

### API samples

Domino recommends using [Service Accounts](/cloud/admin/identity-and-access/manage-users/service-accounts) to access the Domino API.

#### Today’s total cost with idle cost shared among allocations

```shell theme={null}
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://$DOMAIN/api/cost/v2/allocation/summary?window=7d&shareIdle=true -G
```

#### Today’s total for a particular Project

```shell theme={null}
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://$DOMAIN/api/cost/v2/allocation/summary?window=1d&&aggregate=projectId&aggregate=projectName&filter=projectId:%$PROJECT-ID%22 -G
```

#### Today’s total for a particular User

```shell theme={null}
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://$DOMAIN/api/cost/v2/allocation/summary?window=7d&shareIdle=true&filter=startingUserId:%$USER-ID%22 -G
```

#### Today’s asset costs

```shell theme={null}
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://$DOMAIN/api/cost/v2/asset?window=1d -G
```

#### Today’s cloud cost

```shell theme={null}
curl -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://$DOMAIN/api/cost/v2/cloudCost/accumulated?window=7d&&aggregate=invoiceEntityID -G
```

## Next steps

See other ways Domino Cost Center can help you optimize the performance of your projects while managing cloud expenditures:

* Prevent overspending on compute and storage by [setting budgets and sending alerts](/cloud/admin/operations/finops/1-budgets-alerts) to team members approaching their limits.

* Optimize [Dataset storage usage](/cloud/admin/data-administration/datasets#set-limits-on-dataset-usage) to reduce cloud storage costs.
