Kubecost API Directory
Welcome to the Kubecost API library! This directory will show you how Kubecost APIs can assist in monitoring, maintaining, and optimizing your cloud spend. Learn also how Kubecost APIs power different features of the UI below.
The Allocation API retrieves cost allocation information for any Kubernetes concept, e.g. cost by namespace, label, deployment, service, and more. This API is directly integrated with the Kubecost ETL caching layer and CSV pipeline so it can scale for large clusters.
The Trends API compares cost usage between two windows of the same duration and presents a percentage value showing the change in cost.
The Assets API retrieves the backing cost data broken down by individual Kubernetes assets (e.g. node, disk, etc.), and provides various aggregations of this data. Optionally provides the ability to integrate with external cloud assets.
The Asset Diff API compares two asset sets between two windows of the same duration and accumulates the results.
The Cloud Costs API retrieves cloud cost data from cloud providers by reading cost and usage reports. Unlike the Allocation and Asset APIs, it must be manually enabled.
The Budget API allows you to establish spending budget rules for your workload across clusters and namespaces to ensure you don't go over your allotted budget.
The Cost Events Audit API presents recent changes at the cluster level.
The Prediction API takes Kubernetes objects as input and produces an estimation of the cost impact when making changes to your workload.
The Events API provides a log of different occurrences in your workload in order to help with troubleshooting. Logs generated with this API are helpful for submitting bug reports.
Savings endpoints provide cost optimization insights. The following savings endpoints are available at
Many, but not all, Kubecost APIs power different features in the Kubecost UI. The UI counterpart may not fully reflect all functionality of the corresponding API. Please consult the original API docs for complete details.