Recommendations
A recommendation is one pending savings opportunity LevelFour found in your cloud accounts. Each one carries the affected service, the estimated monthly and annual savings, and the actions available on it: accept, reject, execute.
Pagination has the defaults, the page-size cap, and the auto-paginating iterators the examples below rely on.
Methods
| Method | Returns |
|---|---|
| Get savings by provider | A summary of potential savings grouped by cloud provider |
| Get potential savings | A potential savings summary grouped by provider |
| Get overview | Total spend, available savings, pending savings and saved-to-date, across every provider |
| List recommendations | A paginated list of every recommendation. Sorts, does not filter |
| Get recommendation | The full detail for one recommendation |
| Get provider overview | The same metrics as Get overview, for one provider |
| List by provider | A paginated list for one provider, with filters |
| List in-progress | Every recommendation in processing status |
Get savings by provider
Returns a summary of potential savings grouped by cloud provider (AWS, GCP, Azure, K8s).
summary = client.recommendations.get_savings_by_provider()Get potential savings
Returns a potential savings summary grouped by provider.
potential = client.recommendations.get_potential_savings()Get overview
Returns overview metrics across all providers: total spend, available savings, pending savings, and saved-to-date.
overview = client.recommendations.get_overview()List recommendations
Returns a paginated list of every recommendation.
page = client.recommendations.list(
page=1,
page_size=50,
sort_by="monthly_savings",
sort_order="desc",
)
for rec in page:
print(f"{rec.service}: ${rec.monthly_savings}/mo")Parameters
| Parameter | Type | Description |
|---|---|---|
page | int | Page number, 1-indexed |
page_size | int | Items per page |
sort_by | string | Sort field: recommendation_id, service, environment, monthly_savings, annual_savings, savings_percentage, analysis_period, created_at |
sort_order | string | asc or desc |
Get recommendation
Returns the full detail for one recommendation.
detail = client.recommendations.get("rec_123")Get provider overview
Returns the same metrics as Get overview, scoped to a single provider: total spend, available savings, pending savings, and saved-to-date. Use it for a per-provider dashboard header.
overview = client.recommendations.get_provider_overview("aws")List by provider
Returns a paginated per-provider recommendations list, filtered by service, environment, account, tag, and display status. Each row includes monthly and annual savings, current spend, and a savings percentage.
page = client.recommendations.list_by_provider(
"aws",
page=1,
page_size=20,
service=["EC2", "RDS"],
environment=["production"],
display_status=["available"],
sort_by="monthly_savings",
sort_order="desc",
)
for rec in page:
print(f"{rec.service}: ${rec.monthly_savings}/mo")Parameters
| Parameter | Type | Description |
|---|---|---|
page | int | Page number, 1-indexed |
page_size | int | Items per page |
sort_by | string | Sort field: recommendation_id, service, environment, account, tag, monthly_savings, savings_percentage, status |
sort_order | string | asc or desc |
service | string[] | Filter by service |
environment | string[] | Filter by environment |
account | string[] | Filter by account ID |
tag | string[] | Filter by tag |
display_status | string[] | Filter by status: available, pending, processing, optimized, rejected, unavailable |
Filtering and sorting has recipes built on these parameters: the "RDS delete candidates" pattern, top-N-by-savings ranking, and CSV export.
List in-progress
Returns every recommendation currently in processing status.
processing = client.recommendations.list_in_progress()RecommendationItem
Returned in paginated list responses.
| Field | Type | Description |
|---|---|---|
recommendation_id | string | Unique business identifier |
service | string | Cloud service name |
environment | string? | Environment tag |
analysis_period | string? | Analysis time window |
monthly_savings | float | Estimated monthly savings |
annual_savings | float | Estimated annual savings |
current_spending | float | Current monthly spend |
savings_percentage | float | Savings as percentage of current spend |
actions | object? | Available actions for this recommendation |
Find high-value AWS recommendations
from levelfour import LevelFour
client = LevelFour()
for rec in client.recommendations.list_by_provider(
"aws",
page_size=20,
sort_by="monthly_savings",
sort_order="desc",
display_status=["available"],
):
if rec.monthly_savings > 100:
print(f"{rec.recommendation_id}: ${rec.monthly_savings}/mo")Next
- Savings is the realized side: what was accepted, implemented and measured
- Providers is the
providersnamespace: provider-scoped recommendations, realized savings, costs and the filter values you can pass - Pagination has the iterators, the defaults and the page-size cap
- Error handling has the codes these methods raise