AI Budget
AI Budget
The AI Budget view lets you set token and monetary spending caps to prevent runaway API costs. Caps can be applied globally, per provider, per Joomla group / WordPress role, or per individual user.
Concepts
| Term | Meaning |
|---|---|
| Token cap | Maximum number of tokens (input + output) allowed per period |
| USD cap | Maximum dollar spend per period |
| Period | daily, weekly, or monthly (rolling) |
| Scope | Global · Provider · Group/Role · User |
| Alert threshold | % of cap at which an email notification is sent |
Caps are evaluated in order: User → Group → Provider → Global. The most restrictive cap that applies wins.
Budget list
Navigate to JoomlaAI → AI Budget.
The list shows all active budget rules:
| Column | Description |
|---|---|
| Name | Human label (e.g., "Global monthly cap", "Editors — daily limit") |
| Scope | Global / Provider / Group / User |
| Period | Daily / Weekly / Monthly |
| Token cap | Max tokens (blank = unlimited) |
| USD cap | Max USD (blank = unlimited) |
| Used | Tokens / USD consumed in the current period |
| % | Bar chart of consumption |
| Alerts | 70% / 90% / 100% alert status |
| Status | Active / Paused |
Creating a budget rule
Click New in the toolbar.
| Field | Required | Description |
|---|---|---|
| Name | Yes | Label for this rule |
| Scope | Yes | Global / Provider / Group / User |
| Target | If scope ≠ Global | Pick the provider, group, or user |
| Period | Yes | Daily / Weekly / Monthly |
| Token cap | No | Leave blank for unlimited |
| USD cap | No | Leave blank for unlimited |
| Alert at 70% | ON | Send email when 70% consumed |
| Alert at 90% | ON | Send email when 90% consumed |
| Alert at 100% | ON | Send email when cap is hit |
| Action at 100% | block or warn | Block further requests or just notify |
| Status | Yes | Active / Paused |
Alert notifications
Alert emails are sent to the site administrator email address when a threshold is crossed.
Example email subject: [JoomlaAI] Budget alert — Editors group has used 90% of monthly token cap
To change the alert recipient, update the From email in Configuration → Mail (Joomla) or Settings → Email (WP).
Real-time budget widget
The Dashboard shows a Budget used KPI card. When any rule reaches 90% it turns amber; at 100% it turns red.
The Health Check view also shows budget status under the Budget section.
FREE_ONLY mode
If no provider API keys are configured, the system enters FREE_ONLY mode: only locally-hosted providers (Ollama) are available and budget tracking is skipped. This is shown on the Dashboard and Budget pages as an informational banner.
Token pricing reference
Token costs are calculated using the rates in PricingHelper. Approximate rates:
| Provider | Model | Input (per 1M tokens) | Output (per 1M tokens) |
|---|---|---|---|
| Claude | Haiku 4.5 | $0.80 | $4.00 |
| Claude | Sonnet 4 | $3.00 | $15.00 |
| Claude | Opus 4.1 | $15.00 | $75.00 |
| OpenAI | GPT-4o mini | $0.15 | $0.60 |
| OpenAI | GPT-4o | $2.50 | $10.00 |
| Gemini | Flash 2.0 | $0.075 | $0.30 |
| Groq | Llama 3.3 70B | $0.59 | $0.79 |
Rates are approximate and may change. Always verify at the provider's pricing page.
Permissions
| Capability | Access |
|---|---|
joomlaai.budget / wpai_manage_budget | Create and edit budget rules |
core.admin / manage_options | Delete budget rules |
core.manage / wpai_dashboard | View budget (read-only) |
_Last updated: 2026-05-19 · v2.5.3_


