# NEXUS AI Usage and Audit Logs

Usage shows what an organization consumes. The audit log records who did what, including actions taken by agents.

## Usage

| Route | Returns |
|---|---|
| `GET /api/usage/stats` | Usage summary for the organization |
| `GET /api/usage/history` | Usage over time |
| `GET /api/usage/ai-requests` | AI request counts |

MCP: `nexusai_usage_stats`. Needs the `usage.read` permission (Owner, Admin, Auditor, Billing Manager).

## Audit log

| Route | Returns |
|---|---|
| `GET /api/audit/logs` | Audit events, filterable |
| `GET /api/audit/event-types` | The event types that can appear |
| `GET /api/audit/security-summary` | Security event summary |
| `GET /api/audit/security-metrics` | Security metrics |
| `GET /api/audit/export` | Export of the audit log |
| `GET /api/audit/user/{userId}` | Events for one user |

Needs the `audit.read` permission (Owner, Admin, Auditor). There is no MCP tool for the audit log.

## What is recorded

Platform actions such as deployments, secret changes, managed database connection reads, backups, restores, and configuration changes. Each entry has a timestamp, the actor, and the result. Use `GET /api/audit/event-types` for the exact list.

## Related resources

- [Security](/docs/security.md)
- [Organizations](/docs/organization.md)
