Skip to main content
GET
Cost Summary
string
Kubernetes namespace whose ledger to read. Empty aggregates every namespace’s ledger.
string
Start of the window, RFC 3339
string
End of the window, RFC 3339. from and to are an absolute period: with both, exactly [from, to]; with only from, it runs to now; with only to, the 30 days ending at to; with neither, the last 30 days.

Summary Fields

Minimum role: viewer. A namespace with no chatcli-cost-ledger yet answers 200 with zero totals; any other failure to read the ledger returns 500 (failed to read the cost ledger: ...) instead of zeros. Each LLM call is priced at its own model’s rate when it is booked and added to the incident’s total, and concurrent bookings retry on conflict, so none is lost. There is no ROI, downtime-cost or per-incident breakdown in the response. The ledger lives in one chatcli-cost-ledger ConfigMap per namespace (found by the label app.kubernetes.io/managed-by: chatcli-operator when aggregating); see Capacity, Noise and Cost for its format and the pricing override.

Authorizations

X-API-Key
string
header
required

API key sent in the X-API-Key header. Keys are read from the Secret chatcli-operator-secrets, key api-keys (fallback: ConfigMap chatcli-operator-config, key api-keys) in the operator namespace, as a YAML list of {key, role, name, description} (name is the identity recorded on approval decisions); the operator chart creates it only with apiKeys.create: true. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds; deleting both the Secret and the ConfigMap revokes every key. With no keys configured every /api/ call returns 401, unless CHATCLI_OPERATOR_DEV_MODE=true, which grants admin without a key (development only).

Query Parameters

namespace
string

Ledger to read. Empty aggregates every namespace.

from
string<date-time>

Start of the time range (RFC3339). Unparseable values are ignored.

Example:

"2026-03-01T00:00:00Z"

to
string<date-time>

End of the time range (RFC3339). Unparseable values are ignored.

Example:

"2026-03-19T23:59:59Z"

Response

Cost summary

apiVersion
string
Example:

"v1"

kind
string
Example:

"CostSummary"

spec
object