# Events, Metrics, Usage, Audit, System, Nexus, And Ollama Pool

## Endpoint Summary

| Method | Path | Purpose |
| --- | --- | --- |
| `GET` | `/health` | Liveness |
| `GET` | `/health/ready` | Readiness |
| `GET` | `/health/startup` | Startup complete |
| `GET` | `/version` | Package version and platform |
| `GET` | `/metrics` | Prometheus metrics |
| `GET` | `/v1/events` | Server-sent events |
| `GET` | `/v1/usage` | Token usage and rate limits |
| `GET` | `/v1/audit` | Audit log query |
| `GET` | `/v1/cost` | Cost tracker |
| `GET` | `/v1/system` | System info and resource snapshot |
| `GET` | `/v1/nexus/status` | Nexus peer state |
| `GET` | `/v1/sponsors` | Local sponsor directory cache |
| `GET` | `/v1/ollama/pool/processes` | Ollama process inventory |
| `POST` | `/v1/ollama/pool/cleanup` | Cleanup stale Ollama pool processes |

## Events

`GET /v1/events` is an SSE stream. Filter by exact type or prefix:

```text
/v1/events?type=tool.called
/v1/events?type=tool.*
```

Documented event families include:

- `config.changed`
- `run.started`
- `run.completed`
- `run.aborted`
- `run.failed`
- `tool.called`
- `memory.written`
- `memory.searched`
- `skill.invoked`
- `mcp.called`
- `engine.state_changed`
- `auth.failed`
- `rate_limit.hit`
- `incident.raised`
- `incident.resolved`
- `session.created`
- `session.ended`
- `aims.policy_changed`
- `aims.decision_recorded`

## Usage And Cost

Usage endpoints support dashboards for requests, token counts, rate limits, and provider cost estimates. Sponsor and COHERE dashboards should use these concepts consistently: requests per minute, daily tokens, concurrency, per-peer tokens, and per-model tokens.

## Nexus And Sponsors

`/v1/nexus/status` reports peer mesh state. `/v1/sponsors` exposes the local sponsor directory cache.

## Ollama Pool

The pool endpoints are admin-oriented process hygiene tools. They report managed `ollama serve` processes and cleanup decisions. Cleanup accounts for stale pool state and orphan runner risks.
