Control
Budget and cost
Each project gets a monthly budget in USD and an alert threshold. Spend is calculated on every request as tokens × model price, as soon as the request completes. BaseLLM doesn't connect to the provider's billing system.
Project monthly budget
Budgets are per project, monthly and in USD; in the UI, go to Project › Limits & policy. The alert threshold is the budget_alert_percent field: 80% by default, range 1–100. When the budget runs out, the project's enforcement mode applies (enforcement: block | warn).
| Situation | Behavior |
|---|---|
| Threshold reached | A budget_alert record is logged; requests continue |
| Where threshold records go | Audit Log and SIEM |
| Budget used up · Block | 429 budget_exceeded, scope: project |
| Budget used up · Block | No fallback to a backup model either |
| Budget used up · Warn only | Request passes; a monthly_budget record is logged |
| Start of month | Spend resets automatically |
How spend is calculated
cost = input × input price / 1M
+ output × output price / 1M
Input and output are the token counts the provider reports in its response; the price is the list price per 1 million tokens that an admin enters on the Model Fleet screen. Cost is calculated once, as soon as the request completes, and written to the log. At a sample price of $0.25 input and $2 output per 1M, 1,000 input + 500 output tokens cost $0.00125.
- List prices are used; invoice discounts, batch pricing and taxes aren't reflected.
- Provider prompt caching discounts are taken into account.
- For streaming requests, token counts are always requested from the provider.
- If an interrupted stream reports no count, ≈ 4 characters = 1 token is used.
Unpriced models and unpriced requests
- If a model on the project has no USD price, you can't save a budget.
- You can't attach an unpriced model to a project with a budget, and you can't delete a price that's in use.
- A model priced in another currency counts as unpriced for budgets.
- Unpriced requests are logged without a cost and aren't added to spend.
- Adding a price later doesn't recalculate earlier requests.
- If a price changes, earlier requests keep the old price.
A day with no calculated cost isn't drawn as zero on the chart: it's shaded gray with the note "Unpriced: cost not calculated". Amounts below 0.0001 are shown with 2 significant digits (e.g. USD 0.000028).
Cost trend and month-end forecast
forecast = spend this month ÷ days elapsed × days in month
- The forecast appears from the 3rd day of the month; the first 2 days show "—".
- The All / 30D / 7D / Today selector doesn't change the forecast; it always uses the current month.
- If there are unpriced requests this month, a "Forecast may be incomplete" warning appears.
- The forecast is linear; it doesn't account for weekend or campaign swings.
- The trend card switches between Token and Cost views; up to 30 days.
| Executive Summary card | What it shows |
|---|---|
| Usage trend | Daily tokens (input/output) or cost |
| This month · Month-end forecast | Month-to-date spend and forecast |
| Model breakdown | Requests, token share, amount, "x/y requests unpriced" |
| Latency | Average, p50, p95 (p95 needs at least 20 requests) |
| Top users | Top 5 people by X-FFM-User |
| Limit Violations | Violations by outcome, policy and project |
| Provider Health | Failed request rate by model and provider |
Time zone, cache savings and API
"This month" starts at 00:00 on the 1st, based on the USAGE_QUOTA_TIMEZONE setting; the default is Europe/Istanbul (Oct 1 00:00 Turkey time = Sep 30 21:00 UTC). Trend, quotas and budgets all use the same setting. Monthly figures are returned under usage.monthToDate in the GET /admin/dashboard/overview response; the endpoint is available only to the system_admin role.
| Model (access path) | Cached / total prompt | Savings |
|---|---|---|
| OpenAI gpt-5-mini | 7,680 / 7,838 tokens | 77% |
| Claude Haiku 4.5 (OpenRouter) | 10,699 / 10,699 tokens | 89% |