Skip to main content

Clusters API

Manage Kubernetes clusters connected to K8Cost.

List Clusters

GET /api/v1/clusters
{
"clusters": [
{
"id": "cls_01h9xk...",
"name": "production-us-east",
"provider": "aws",
"region": "us-east-1",
"status": "active",
"node_count": 12,
"pod_count": 156,
"monthly_cost": 4250.00,
"last_sync_at": "2026-04-01T12:00:00Z"
}
]
}

Create Cluster

POST /api/v1/clusters
{
"name": "staging-eu-west",
"provider": "aws",
"region": "eu-west-1"
}

Get Cluster Summary

GET /api/v1/clusters/{cluster_id}/summary

Returns cost breakdown, node utilization, top recommendations, idle cost classification, and potential savings.

Sync Cluster

POST /api/v1/clusters/{cluster_id}/sync

Triggers an immediate re-sync of cluster resources and cost recalculation.

Delete Cluster

DELETE /api/v1/clusters/{cluster_id}

Removes the cluster and all associated data.

Idle Costs

GET /api/v1/idle-costs?cluster_id={cluster_id}

Returns the workload / workload_idle / cluster_idle cost breakdown for the cluster.