---
title: "Aggregated instance usage CLI reference"
description: "Customer-hosted cloud features"
---

# Aggregated instance usage CLI reference

#### Customer-hosted cloud features

:::note
Some features are only available on customer-hosted clouds. Reach out to [support@anyscale.com](mailto:support@anyscale.com) for info.
:::

## Aggregated instance usage CLI

### `anyscale aggregated-instance-usage download-csv`

**Usage**

`anyscale aggregated-instance-usage download-csv [OPTIONS]`

Download an aggregated instance usage report as a zipped CSV to the provided directory.

**Options**

-   **`--start-date`**: The start date (inclusive) of the aggregated instance usage report. Format: YYYY-MM-DD
-   **`--end-date`**: The end date (inclusive) of the aggregated instance usage report. Format: YYYY-MM-DD
-   **`--cloud`**: The name of the cloud to filter the report by.
-   **`--project`**: The name of the project to filter the report by.
-   **`--directory`**: The directory to save the CSV file to. Default is the current directory.
-   **`--hide-progress-bar`**: Whether to hide the progress bar. Default is False.

#### Examples

::::tabs

:::tab[CLI]
```bash
$ anyscale aggregated-instance-usage download-csv --start-date 2024-10-01 --end-date 2024-10-03
(anyscale +0.5s) Downloading aggregated instance usage CSV...
Download complete! File saved to 'aggregated_instance_usage_2024-10-01_2024-10-03.zip'
0:00:01 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.4 kB / 79.4 kB Downloading aggregated instance usage CSV
(anyscale +2.2s) Downloaded CSV to aggregated_instance_usage_2024-10-01_2024-10-03.zip
```
:::

::::

## Aggregated instance usage models

### `DownloadCSVFilters`

Filters to use when downloading usage CSVs.

#### Fields

-   **`start_date` (str)**: Start date (UTC inclusive) for the usage CSV.
-   **`end_date` (str)**: End date (UTC inclusive) for the usage CSV.
-   **`cloud` (str | None)**: Optional cloud name to filter by.
-   **`project` (str | None)**: Optional project name to filter by.
-   **`directory` (str | None)**: Optional directory to save the CSV to.
-   **`hide_progress_bar` (bool | None)**: Optional hide progress bar.

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale
from anyscale.aggregated_instance_usage.models import DownloadCSVFilters

download_csv_filters = DownloadCSVFilters(
    # Start date (UTC inclusive) for the usage CSV.
    start_date="2024-10-01",
    # End date (UTC inclusive) for the usage CSV.
    end_date="2024-10-31",
    # Optional cloud name to filter by.
    cloud="cloud_name",
    # Optional project name to filter by.
    project="project_name",
    # Optional directory to save the CSV to.
    directory="/directory",
    # Optional hide progress bar.
    hide_progress_bar=False,
)
```
:::

::::

---

Previous: [CLI quickstart](/reference/quickstart-cli.md) | Next: [Cloud](/reference/cli/cloud.md)