Resources

Savings

Overview

The Savings resource tracks realized savings from recommendations that have been accepted and implemented. Each savings record includes pre- and post-optimization costs, the implementation period, and return on investment.

Methods

Get Summary

Returns an aggregate summary of all realized savings: total saved, monthly savings rate, and savings breakdown.

summary = client.recommendations.audit.get_summary()

List Savings

Returns a paginated list of all implemented savings with filtering by date, provider, service, environment, and 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

ParameterTypeDescription
pageintPage number (1-indexed)
page_sizeintItems per page (max 100)
sort_bystringSort field: period, account_id, environment, service, usage_type, usage_quantity, usage_unit, pre_optimization_cost, post_optimization_cost, monthly_savings, roi, approved_by
sort_orderstringasc or desc
startstringStart date (YYYY-MM-DD or YYYY-MM)
endstringEnd date (YYYY-MM-DD or YYYY-MM)
presetstringDate preset: 30D, 6M, or 12M (overrides start/end)
providerstringFilter by provider: aws, gcp, azure, k8s
servicestring[]Filter by service(s)
environmentstring[]Filter by environment(s)
account_idstring[]Filter by account ID(s)

Response Types

SavedItem

FieldTypeDescription
periodstringSavings period identifier
account_idstring?Cloud account ID
environmentstring?Environment tag
servicestringCloud service name
usage_typestringType of usage
usage_quantityfloatQuantity of usage
usage_unitstringUnit of usage
approved_bystring?Who approved the optimization
pre_optimization_costfloatCost before optimization
post_optimization_costfloatCost after optimization
monthly_savingsfloatMonthly savings amount
annual_savingsfloatAnnual savings amount
roifloatReturn on investment

Example: Last 6 Months of Savings by Provider

from levelfour import LevelFour

client = LevelFour()

for provider in ["aws", "gcp", "azure"]:
    summary = client.providers.get_realized_savings_summary(provider)
    print(f"{provider}: {summary}")