API REFERENCE

REST API Overview

Introduction to the Kubeadapt REST API for Kubernetes cost data. Covers base URL, versioning, rate limiting, CORS, health endpoints, and request format.

The Kubeadapt REST API gives you programmatic access to cluster metrics, cost data, workload details, and optimization recommendations. All data is scoped to your organization automatically. For terminal-based access, see the CLI.

Base URL

text
https://public-api.kubeadapt.io/v1/

All endpoints are prefixed with /v1/.

Versioning

The current API version is v1. The version prefix is part of every endpoint path. Breaking changes will be introduced under a new version prefix rather than modifying existing endpoints.

Request Format

All requests use JSON. The API is read-only, so every endpoint uses the GET HTTP method. You don't need to set Content-Type for requests without a body, but responses always return application/json.

Rate Limiting

The API enforces rate limits per API key. The current default is 100 requests per minute per key. Every authenticated response includes these headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp when the window resets

When the limit is exceeded, the API returns 429 Too Many Requests with a Retry-After header indicating how many seconds to wait.

Tip

If you need higher limits for a production integration, contact support.

Health endpoints

These endpoints don't require authentication. Use them for uptime monitoring or readiness checks.

EndpointResponseDescription
GET /health{"status": "healthy", "version": "<semver>"}Returns API status and version
GET /health/live{"status": "alive"}Liveness probe
GET /health/ready{"status": "ready", "checks": {"postgres": "ok"}}Readiness probe, verifies PostgreSQL connectivity. Returns 503 with {"status": "not_ready", ...} on failure.

Example:

bash
curl https://public-api.kubeadapt.io/health
json
{ "status": "healthy", "version": "0.1.0" }

OpenAPI Specification

Interactive API documentation (Swagger UI at /docs and ReDoc at /redoc) is available in development environments only.

Request Headers

Every response includes an X-Request-Id header (UUID). You can pass your own X-Request-Id in the request to trace calls through your systems.