# AI Spend Caps reference

<!-- prettier-ignore-start -->

Developer reference for `capell-app/ai-spend-caps`. Start with the [README](../README.md) for what the extension does and how to install it.

## Package Details

AI Spend Caps is an **Available** Capell package in the **Capell AI** product group. It ships as `capell-app/ai-spend-caps` and extends these surfaces: admin.

- Status: Available
- Tier: free
- Bundle: ai
- Composer package: `capell-app/ai-spend-caps`
- Namespace: `Capell\AiSpendCaps`
- Theme key: not applicable

## Technical Shape

### Service providers

- `Capell\AiSpendCaps\Providers\AiSpendCapsServiceProvider`

### Config files

- `packages/ai-spend-caps/config/capell-ai-spend-caps.php`

### Migrations

- `packages/ai-spend-caps/database/migrations/2026_11_11_000002_index_ai_generation_histories_for_spend.php`

### Settings migrations

- `packages/ai-spend-caps/database/settings/2026_11_11_000001_01_create_ai_spend_caps_settings.php`

### Settings classes

- `SpendCapSettings`

### Filament classes

- `AiUsagePage`
- `SpendCapSettingsSchema`

### Events

- `AiSpendWarningReached`

### Actions

- `BuildSpendReportAction`
- `SendSpendWarningAction`

### Data objects

- `SpendReportData`

### Manifest contributions

- `admin-page: Capell\AiSpendCaps\Manifest\AiSpendCapsAdminPageContribution`

### Health checks

- `Capell\AiSpendCaps\Health\AiSpendCapsHealthCheck`

### Blade views

- `packages/ai-spend-caps/resources/views/filament/pages/usage.blade.php`

## Data Model

- Required tables: `ai_generation_histories`.
- Migration files: `2026_11_11_000002_index_ai_generation_histories_for_spend.php`.
- Migration impact: run host migrations through the package install flow before opening package surfaces.
- Deletion/retention behaviour: Docs gap: migrations and manifest contributions do not prove a cascade, pruning command, or timed retention policy.

<!-- prettier-ignore-end -->