Resources

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

ParameterTypeDescription
pageintPage number, 1-indexed
page_sizeintItems per page
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
providerstringFilter by provider: aws, gcp, azure, k8s
servicestring[]Filter by service(s)
environmentstring[]Filter by environment(s)
account_idstring[]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.

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
Each row carries a full monthly rate. Adding 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 page and page_size, and the iterators that page for you
  • /api-reference/audit is the generated REST reference for the endpoints behind these methods