---
title: Costs and Observability
description: Inspect spend, budgets, usage limits, traces, metrics, and anomaly rules from the CLI.
---

Cost and observability commands read the same meters and telemetry exporters as the **[Cost](/docs/using-the-app/cost)** screen and **[Activity](/docs/using-the-app/runs-and-observability)** traces view.

All verbs require sidecar reachability unless noted.

## Cost summary

```bash
akos costs summary
akos costs summary --workspace default --window-hours 168 --json
```

Aggregate spend for the configured window (default: recent hours).

## Breakdown

```bash
akos costs breakdown --group-by provider --from 2026-07-01 --to 2026-07-05
akos costs breakdown --group-by role --provider openai --json
```

`groupBy` is required by the sidecar contract (`provider`, `role`, `workspace`, …).

## Budgets and alerts

```bash
akos costs budgets --json
akos costs alerts --json
akos costs list --json
```

`costs list` returns itemized rows suitable for CSV piping; `costs alerts` surfaces budget threshold breaches.

## Tenant usage meter

Cloud tenants expose backend-computed usage limits (do not recompute limits in scripts):

```bash
akos usage status --json
akos usage watch --once --json
akos usage watch --sse --timeout-ms 60000
```

`usage watch` exits non-zero when status is `blocked` or `exceeded` — useful in CI guardrails.

## Per-run cost

For a single execution, use the runs cockpit:

```bash
akos runs show <runId> --json
akos runs logs <runId> --json
```

Token and USD fields appear in the enriched run detail payload.

## Observability

```bash
akos observability status --json
akos observability metrics tokens.in --range 24h --json
akos observability traces <runId> --json
akos observability logs --workspace default --json
```

Metrics ids include `tokens.in`, `tokens.out`, `cost.totalUsd`, `errors.count`, and `p99.latencyMs`.

### Anomaly rules

```bash
akos obs anomaly-rules --json
```

Companion to `observability` — lists structured anomaly rules and paused state.

### Live tails

Poll-based streaming (ADR-0133) — safe for CI with deadlines:

```bash
akos logs tail --interval 2000 --workspace default
akos runs tail --interval 1500
akos runs watch <runId> --json
```

Set `AKOS_STREAM_INTERVAL_MS` to tune poll cadence.

## Interactive shell shortcuts

In `akos chat --interactive` or `--tui`, slash commands mirror these surfaces:

- `/cost` — spend summary for the session window
- `/runs`, `/run <id>`, `/watch <id>`, `/logs <id>` — run inspection
- `/tail <id>` — snapshot status + recent events

See **[Command reference](/docs/cli/command-reference)** › Interactive shell.

## Related topics

- **[Cost in the app](/docs/using-the-app/cost)** — budgets, billing tab, spend charts.
- **[Activity](/docs/using-the-app/runs-and-observability)** — run list, traces, observability health.
- **[Flows and Runs](/docs/cli/flows-and-runs)** — `runs show`, `runs watch`, retention prune.
- **[Dashboard](/docs/using-the-app/dashboard)** — live cost summary card.
- **[Command reference](/docs/cli/command-reference)** — full `costs`, `usage`, and `observability` tables.