> ## 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.

# Cost Forecasting: How InfraAudit Models Spend

> How InfraAudit ingests daily billing data from AWS, GCP, and Azure to generate 30, 60, and 90-day spend forecasts using provider-native and trend-based models.

InfraAudit ingests billing data from each connected cloud provider and generates forecasts for the next 30, 60, and 90 days. Forecast accuracy improves as billing history accumulates — expect rough estimates for the first two weeks, reasonable estimates after four weeks, and reliable forecasts after eight or more weeks.

## Billing data ingest

Each cloud provider exposes billing data through a different API. InfraAudit handles each one:

| Provider | Source                            | Granularity |
| -------- | --------------------------------- | ----------- |
| AWS      | Cost Explorer (`GetCostAndUsage`) | Daily       |
| GCP      | BigQuery billing export table     | Daily       |
| Azure    | Cost Management API               | Daily       |

The cost sync job runs daily at 03:00 UTC by default and pulls the previous day's finalized billing data.

<AccordionGroup>
  <Accordion title="AWS billing notes">
    Cost Explorer data has a 24-hour lag. Data for day D is available by approximately 08:00 UTC on day D+1. Applying **Cost Allocation Tags** in AWS enables resource-level attribution — InfraAudit can break down costs by tag when they're available.
  </Accordion>

  <Accordion title="GCP billing notes">
    BigQuery billing export must be configured before InfraAudit can ingest GCP cost data. Once configured, data typically appears within 2–4 hours of the billing period. See [GCP integration setup](/integrations/gcp) for instructions.
  </Accordion>

  <Accordion title="Azure billing notes">
    Azure Cost Management data is generally available within 24 hours. Billing data is synced daily automatically once you connect an Azure subscription.
  </Accordion>
</AccordionGroup>

## Forecasting methodology

InfraAudit uses two forecasting approaches:

### Provider-native forecasts

For AWS and Azure, InfraAudit sources the forecast from the provider's own forecasting API:

* **AWS** — `GetCostForecast` with a 90-day horizon and daily granularity
* **Azure** — Cost Management forecast API

These forecasts use proprietary models trained on your account's full billing history. InfraAudit caches the results and displays them as the primary forecast for those providers.

### InfraAudit trend model

For GCP (which doesn't offer a native forecasting API) and as a secondary validation for AWS and Azure, InfraAudit runs a linear trend model over the last 30 days of billing data:

1. Compute a 7-day rolling average to smooth day-of-week effects.
2. Fit a linear regression to the last 30 days.
3. Project forward using the regression slope.

The confidence interval widens with the forecast horizon — the 90-day forecast has significantly more uncertainty than the 30-day one.

## What the forecast shows

In the **Cost** section of the dashboard, you'll see:

* **This month to date** — actual spend through yesterday
* **Remaining days** — forecast spend for the rest of the current month
* **End-of-month estimate** — actual spend plus forecasted remainder
* **30/60/90-day outlook** — three forecast horizons with confidence bands

## Improving forecast accuracy

* More billing history means better forecasts. Accuracy improves noticeably after 8+ weeks of connected data.
* For AWS, enabling **Cost Allocation Tags** and tagging your resources improves resource-level attribution and forecast breakdown by service or team.
* For GCP, configuring **BigQuery billing export** as early as possible maximizes the historical data available to the trend model.

## Anomaly detection

InfraAudit also checks each new daily data point against the forecast baseline to detect unexpected cost spikes. See [Anomaly detection](/concepts/anomaly-detection) for how that works.
