Savings
These methods read what your accepted recommendations actually saved. Get summary returns the aggregate. List savings returns one row per implemented saving, carrying the cost before and after the optimization, the period, and the return on investment.
Pagination has the defaults, the page-size cap, and the auto-paginating iterators the examples below rely on.
Get summary
Returns the aggregate across every realized saving: total saved, the monthly savings rate, and the split by provider.
summary = client.recommendations.audit.get_summary()List savings
Returns a page of implemented savings, filtered by date, provider, service, environment or account.
page = client.recommendations.audit.list(
page=1,
page_size=50,
sort_by="monthly_savings",
sort_order="desc",
provider="aws",
start="2025-01-01",
end="2025-03-31",
)
for item in page:
print(f"{item.service}: ${item.monthly_savings}/mo (ROI: {item.roi}x)")Parameters
| Parameter | Type | Description |
|---|---|---|
page | int | Page number, 1-indexed |
page_size | int | Items per page |
sort_by | string | Sort field: period, account_id, environment, service, usage_type, usage_quantity, usage_unit, pre_optimization_cost, post_optimization_cost, monthly_savings, roi, approved_by |
sort_order | string | asc or desc |
start | string | Start date (YYYY-MM-DD or YYYY-MM) |
end | string | End date (YYYY-MM-DD or YYYY-MM) |
preset | string | Date preset: 30D, 6M, or 12M |
provider | string | Filter by provider: aws, gcp, azure, k8s |
service | string[] | Filter by service(s) |
environment | string[] | Filter by environment(s) |
account_id | string[] | Filter by account ID(s) |
preset takes precedence over start and end. Send all three and the window you get back is the preset's, not the dates you typed.SavedItem
The row shape List savings returns.
| Field | Type | Description |
|---|---|---|
period | string | Savings period identifier |
account_id | string? | Cloud account ID |
environment | string? | Environment tag |
service | string | Cloud service name |
usage_type | string | Type of usage |
usage_quantity | float | Quantity of usage |
usage_unit | string | Unit of usage |
approved_by | string? | Who approved the optimization |
pre_optimization_cost | float | Cost before optimization |
post_optimization_cost | float | Cost after optimization |
monthly_savings | float | Monthly savings amount |
annual_savings | float | Annual savings amount |
roi | float | Return on investment |
monthly_savings down a filtered list gives you a run rate, not the cash saved inside the window you filtered.Savings by provider
Get summary returns the split by provider in one call. For one provider's totals on their own, the Providers page owns Get realized savings summary, which the example below calls once per provider.
from levelfour import LevelFour
client = LevelFour()
for provider in ["aws", "gcp", "azure"]:
summary = client.recommendations.audit.get_provider_summary(provider)
print(f"{provider}: {summary}")Next
- Recommendations is the potential side: opportunities LevelFour has found and nobody has applied yet
- Providers scopes realized savings, recommendations and costs to one cloud
- Pagination has the defaults behind
pageandpage_size, and the iterators that page for you /api-reference/auditis the generated REST reference for the endpoints behind these methods