Skip to main content

Cost & Recommendations API

These endpoints expose the two things most integrations need: what you spent, and what KOSTRA recommends you do about it. All calls require the x-optscale-token header (see Authentication).

Query expenses

Returns normalized, resource-level expenses across every connected provider for the organization, filtered by the query parameters you supply. This is the endpoint to pull cost data into a data warehouse or a custom report. Common query parameters: Because expenses are normalized, Huawei Cloud spend is returned in the same shape as AWS, Azure, and Google Cloud, so a single integration handles all providers.

Pool expense breakdown

Returns the expense breakdown for a specific pool, useful for building per-team cost views without post-processing the full expense list.

List recommendations

Returns the organization’s optimization findings — the same recommendations shown in the interface, grouped by type, each with the flagged resources and their estimated savings. Use this to feed recommendations into a ticketing system or a savings dashboard. The response spans every recommendation module that applies to your connected accounts across all providers: abandoned instances, unattached volumes, obsolete snapshots, idle IPs, abandoned load balancers, abandoned object-storage buckets, database rightsizing, and more.

Recommendations for one resource

Returns the recommendations that apply to a single resource, so you can surface “what should I do about this?” in context — for example, next to a resource in your own inventory tool.

A savings-report integration

A common pattern:
  1. GET .../optimizations to retrieve current findings and their savings.
  2. Filter to the categories or services your team owns.
  3. Push each finding to your tracker, and re-pull on a schedule so resolved items drop off as KOSTRA re-evaluates.