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

# infraudit cost — cloud cost report and forecast commands

> infraudit cost report, forecast, anomalies — fetch spend data and projections. Key flags: --provider aws|gcp|azure, --period 30d|60d|90d, --days.

The `cost` command group provides cloud spend analytics: current costs, historical trends, forecasts, anomaly detection, and optimization recommendations. Billing data is pulled from provider APIs using `cost sync`.

## `cost sync`

Pull the latest billing data from all connected cloud providers, or a specific one:

```bash theme={null}
# Sync all providers
infraudit cost sync

# Sync a specific provider
infraudit cost sync --provider aws
```

## `cost overview`

Show a current cost summary across all connected providers:

```bash theme={null}
infraudit cost overview
```

## `cost report`

Fetch a cost report for a specific provider and time period.

**Synopsis:**

```bash theme={null}
infraudit cost report [flags]
```

| Flag         | Values              | Description                |
| ------------ | ------------------- | -------------------------- |
| `--provider` | provider ID         | Filter by provider         |
| `--period`   | `30d`, `60d`, `90d` | Time period for the report |

Example:

```bash theme={null}
infraudit cost report --provider 1 --period 30d
```

## `cost trends`

Show spend trends over time with optional provider and period filters:

```bash theme={null}
# All providers, default period
infraudit cost trends

# AWS spend over the last 30 days
infraudit cost trends --provider aws --period 30d
```

| Flag         | Values                | Description             |
| ------------ | --------------------- | ----------------------- |
| `--provider` | `aws`, `gcp`, `azure` | Filter by provider type |
| `--period`   | `7d`, `30d`, `90d`    | Historical period       |

## `cost forecast`

Project future cloud spend based on historical usage patterns.

**Synopsis:**

```bash theme={null}
infraudit cost forecast [flags]
```

| Flag         | Values           | Description                    |
| ------------ | ---------------- | ------------------------------ |
| `--provider` | provider ID      | Limit forecast to one provider |
| `--days`     | `30`, `60`, `90` | Forecast horizon in days       |

Example:

```bash theme={null}
infraudit cost forecast --provider 1 --days 90
```

## `cost anomalies`

List detected cost anomalies — unusual spikes or drops in spend that may indicate misconfiguration or unexpected usage:

```bash theme={null}
infraudit cost anomalies
```

## `cost detect-anomalies`

Trigger a fresh anomaly detection run against current billing data:

```bash theme={null}
infraudit cost detect-anomalies
```

## `cost optimizations`

Show cloud resource optimization opportunities identified by InfraAudit:

```bash theme={null}
infraudit cost optimizations
```

## `cost savings`

Show total potential savings across all identified optimization opportunities:

```bash theme={null}
infraudit cost savings
```

<Tip>
  For AI-powered savings recommendations with estimated dollar amounts, use [`infraudit recommendation list --type cost`](/cli/commands/recommendation).
</Tip>
