> For the complete documentation index, see [llms.txt](https://docs.opscanvas.io/oscar/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opscanvas.io/oscar/commands/cost-management.md).

# Cost Management

Oscar provides cost tracking and analysis for your cloud infrastructure. Configure cost data sources, monitor warehouse status, and get AI-powered spending insights.

## Setup Cost Tracking

Configure cost data sources with `/cost setup`:

```bash
/cost setup
```

Supports:

* **AWS** - Cost and Usage Reports (CUR)
* **Azure** - Cost Management exports

The setup wizard guides you through selecting your cloud provider, configuring export locations, setting up access credentials, and validating the configuration.

**AWS setup:**

![AWS cost setup](/files/LMPII6vZLqq2KC70XpO1)

**Azure setup:**

![Azure cost setup](/files/fpUYdAD544cpjTNceLuQ)

## Check Warehouse Status

View your cost data warehouse status with `/cost status`:

```bash
/cost status
```

![Cost warehouse status](/files/LE4L4PQerbmlkdQB4bEX)

Shows:

* Configured cost sources
* Last sync time
* Data freshness
* Available date ranges
* Any sync errors or warnings

## Get Cost Summary

Analyze spending patterns with `/cost summary`:

```bash
/cost summary
```

Oscar analyzes your cost data and provides month-over-month spending trends, top cost drivers by service, unusual spending patterns, and cost optimization opportunities.

**Cost breakdown by service:**

See your spending organized by cloud service with month-over-month comparisons and percentage changes.

![Cost summary table](/files/Gd6wS0zQBa28S5l0fRUm)

**Flagged findings:**

Oscar identifies unusual spending patterns, cost spikes, and potential issues that need attention.

![Cost flagged findings](/files/ysRTHCT2ZaJnsKUVBP7d)

**Next steps:**

Get actionable recommendations for cost optimization and investigation priorities.

![Cost next steps](/files/t2G0lnJ54gwWwBpyyUQz)

The summary is AI-generated based on your actual cost data, providing context-aware insights specific to your infrastructure.

## Cost Data Warehouse

Oscar uses DuckDB to create a local cost data warehouse. Cost data is:

* Synced from your cloud provider's cost exports
* Stored locally in `~/.config/oscar/cost/`
* Queried for analysis and reporting
* Never sent to external services (runs entirely locally)

## Notes

* Cost data requires initial setup via `/cost setup`
* First sync may take several minutes depending on data volume
* Data is refreshed automatically when you run `/cost status` or `/cost summary`
* Historical data availability depends on your cloud provider's export retention
* All cost analysis runs locally using DuckDB


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.opscanvas.io/oscar/commands/cost-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
