# Get spending summary

> Returns spending summary: overall costs, forecast, savings, and provider breakdown

Source: https://docs.levelfour.ai/api-reference/costs/get-costs-summary


## GET /api/v1/costs/summary

Returns spending summary: overall costs, forecast, savings, and provider breakdown

### Authentication

Send `Authorization: Bearer <token>`.

### Parameters

- `providerId` (query, string, nullable): Scope the summary to one provider. A provider the tenant has not enabled returns an empty summary.
- `credits` (query, one of `before`, `after`, default `after`): Cost basis for Google Cloud: after credits (default) or before them. AWS stays on its invoiced basis.

### Responses

#### 200: Successful Response

- `success` (boolean, default `true`)
- `timestamp` (date-time string)
- `data` (object, required): Spending summary data for BigNumbers section
  - `overall_monthly_costs` (number, required): Total spending across all providers for current month
  - `overall_monthly_costs_percentage` (number, nullable): Same-period MoM change percentage (current MTD vs same days in previous month)
  - `forecasted_monthly_costs` (number, required): Projected full month costs based on daily run rate
  - `forecasted_monthly_costs_percentage` (number, nullable): Forecast vs previous month actual percentage
  - `last_month_spend` (number, required): Total spending for the previous fully closed month
  - `last_month_spend_percentage` (number, nullable): MoM change percentage for previous month vs 2-months-ago
  - `savings_recommendations` (number, required): Total potential savings from pending recommendations
  - `savings_recommendations_percentage` (number, nullable): Change in savings recommendations vs previous month
  - `total_savings` (number, required): Total annual savings from Savings Audit
  - `providers` (array of object, required): Per-provider spending breakdown
    - `provider_id` (string, required): Provider identifier: aws, gcp, azure, k8s
    - `provider_name` (string, required): Display name: AWS, GCP, etc.
    - `monthly_spending` (number, required): Current month spending for this provider
    - `monthly_spending_percentage` (number, nullable): MoM change percentage
    - `monthly_spending_change` (number, nullable): MoM change in dollar amount
    - `previous_month_spending` (number, nullable): Previous fully closed month total spending
    - `potential_savings` (number, required): Total potential monthly savings
    - `potential_savings_percentage` (number, required): Savings as percentage of spending
  - `spend_split` (object, nullable): Commit/On-Demand/Spot split for current MTD spend (AWS only). Null when data unavailable.
    - `commit_monthly` (number, required): Reserved/commit usage spend (current month)
    - `on_demand_monthly` (number, required): On-demand usage spend (current month)
    - `spot_monthly` (number, required): Spot usage spend (current month)
  - `credits` (one of `before`, `after`, nullable): Cost basis applied: after or before Google Cloud credits

#### Errors

- `400`: Bad Request
- `401`: Authentication Error
- `403`: Authorization Error
- `404`: Not Found
- `409`: Conflict
- `422`: Validation Error
- `429`: Rate Limit Exceeded
- `500`: Internal Server Error

Body of `400`, `401`, `403`, `404`, `409`, `422`, `429`, `500`:

- `success` (`false`, required)
- `error` (object, required)
  - `code` (string, required)
  - `message` (string, required)
  - `details` (any)
- `timestamp` (date-time string, required)
