> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnao.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Budgets

> Cap LLM spend per provider and per user, with alerts and automatic cutoffs

Admins can set a dollar limit on how much each configured LLM provider can spend over a fixed period, and how much any single user can spend against it. When a limit is reached, nao blocks further LLM calls across every channel (web chat, Slack, Microsoft Teams, Telegram, WhatsApp, Mattermost, Discord).

> [!NOTE]
>
> Budgets are admin-only. Open **Settings** -> **Budget**. The page has two tabs: **General**, for the project-wide and per-user limits below, and **Advanced**, for [member and group budgets](#member-and-group-budgets).

## Set a budget

1. Navigate to **Settings** -> **Budget** -> **General**.
2. Pick a provider (Anthropic, OpenAI, Azure OpenAI, Google, Mistral, AWS Bedrock, OpenRouter, Ollama, or any OpenAI-compatible endpoint). Providers declared in `nao_config.yaml` are listed here alongside the ones configured in the UI.
3. Enter a **project limit** in dollars, a **per-user limit**, or both.
4. Choose a reset period: **day**, **week**, or **month**.
5. Save.

Each provider can have its own budget. Providers without a budget are unlimited.

### Providers without built-in prices

nao ships token prices for the models of the major providers. For providers it cannot price on its own - OpenAI-compatible endpoints, Ollama, Azure deployments, or a custom model id - the Budgets page shows *No token prices known for this provider* until you declare the costs yourself:

* In **Models**, open the model's custom model dialog and fill in its **Token cost** fields (USD per million tokens), or
* In `nao_config.yaml`, add a `costs` block to the model under `llm.providers[].models`. See [Model costs](https://docs.getnao.io/nao-agent/context-builder/configuration.md#model-costs).

As soon as one model of the provider has a price, the provider becomes eligible for a budget and its spend is computed from your prices.

### Per-user limits

A project limit caps what the whole team can spend on a provider. A per-user limit caps what any one person can spend against that same provider, in the same period.

The two are independent, and both are enforced:

* A user who hits their own limit is blocked while everyone else keeps working.
* When the project limit is reached, everyone is blocked regardless of individual headroom.

Use a per-user limit to stop one heavy user (or a runaway automation) from consuming the whole team's budget before the period resets.

> [!NOTE]
>
> Per-user limits are gated by the `user-budget` feature on an Enterprise license. Without it, only the project limit applies. See [Enterprise overview](https://docs.getnao.io/nao-agent/enterprise/overview.md#installing-the-license).

### Setting budgets in `nao_config.yaml`

Budgets can also be declared next to the provider in your project config, so they are version-controlled with the rest of your context:

```yaml theme={null}
llm:
  providers:
    - provider: anthropic
      api_key: ${{ env('ANTHROPIC_API_KEY') }}
      budget:
        limit: 500          # project-wide spend limit in USD for the period
        per_user_limit: 50  # per-user spend limit in USD for the period
        period: month       # day, week, or month (defaults to month)
```

At least one of `limit` and `per_user_limit` is required. `period` defaults to `month`. These budgets show up on the Budgets page like any other.

## Member and group budgets

The provider budgets above cap spend **per provider**. Member and group budgets cap how much **each member** can spend on AI models over a period, **across all providers combined**, and let you set that cap per user group or per person. They live on the **Advanced** tab: **Settings** -> **Budget** -> **Advanced**.

![Advanced tab of the Budget page, with the allocated total, the budget period, group budgets and the members table](https://mintcdn.com/naolabs/nsZdDvVuAvv4Ptxo/images/nao-agent/budgets/advanced-budgets.png?fit=max\&auto=format\&n=nsZdDvVuAvv4Ptxo\&q=85\&s=e5560491bbcddf6aa70e77cad7be6280)

> [!NOTE]
>
> Member and group budgets require an **Enterprise license** with the `user-budget` feature. Without it, admins can open the Advanced tab to preview it, but editing is locked behind an upgrade prompt. Provider budgets on the General tab are not gated.

### Overview cards

* **Allocated across all members**: the sum of every member's effective budget. It updates live as you edit, before you save.
* **Budget period**: **Week**, **Month** (default), or **Year**, shared by all member and group budgets. The card shows the next reset date, and the info icon gives the exact range: Monday 00:00 to Sunday 24:00, the 1st to the last day of the month, or January 1st to December 31st, all in UTC. Changing the period previews each member's spend over the new period before you save.

### Group budgets

The **Group budgets** table lists every user group with its member count and a **Budget per member**:

* **All Users** (marked **Default**) sets the default budget for every member of the project.
* Any other group **replaces** that default for its members.

A group budget is a cap **per member** of the group, not a shared pool: with **Com** at $200, each member of Com can spend up to $200 per period. You can also edit a group budget from the [user group editor](https://docs.getnao.io/nao-agent/chat/admin/user-groups.md).

### Members

The **Members** table shows, for each member, their groups, their **Usage** for the current period (for example *Usage (month to date)*), and their effective **Budget**.

* **Usage** turns amber at 80% of the budget and red once the budget is used up.
* Filter by name or email, by group (**All groups**), or by status (**All usage**, **Over budget**, **Close to limit**, **Under budget**, **No limit**). Sort by member, usage, or budget.
* Each budget cell shows the budget the member inherits from their groups. Click it to type a **personal budget**, or use the arrow to pick a preset ($100 steps up to $2,000, or **No limit**) or to go back to the inherited one (**Use group budget** or **Use default**).

Edits are not applied until you click **Save**.

### How a member's budget is resolved

Each member's effective budget is picked in this order:

1. Their **personal budget**, if one is set.
2. Otherwise, the **most generous** budget among their groups. A group set to **No limit** wins over any amount.
3. Otherwise, the **All Users** default.

In the screenshot above, a member of **Com** without a personal budget gets $200, and everyone else gets the $350 default. A personal budget of \$1 overrides both.

Budgets are whole-dollar amounts, and **0 (No limit)** means unlimited.

> [!NOTE]
>
> When a member has a personal or group budget, it replaces the **per-user limit** of provider budgets for that member. The **project limit** of each provider still applies to everyone.

### What members see

* At 80% of their budget, a banner in the chat warns them, for example *"You've used 85% of your user group budget for this month."*, with the reset date.
* At 100%, their requests are blocked on every channel until the period resets, and they get an in-app notification. Other members keep working.
* Members don't see the Advanced tab. They see a read-only **Your budget** card with their own budget and current-period spend.

To unblock a member before the reset, raise their personal budget or their group's budget.

### Export member usage to CSV

In the **Members** card of the **Advanced** tab, click **Export CSV** to download `budget-usage-YYYY-MM-DD.csv`. The button is disabled while you have unsaved edits: save or cancel them first.

The file has one row per member, highest spend first, with these columns: member, email, groups, period, period start, resets on, usage, budget, budget source, remaining, and status. Members with no limit have an empty budget and the status **No limit**.

The same report is available to MCP clients through the `export_member_budgets` tool of the [nao MCP endpoint](https://docs.getnao.io/nao-agent/connectors/mcp.md). It returns the rows as structured data plus a `csv` field. The export is limited to admins (not context admins) and requires the `user-budget` Enterprise feature.

## How spend is tracked

For every LLM call, nao records the cost computed from the provider's token pricing and attributes it to the provider's current period. The Budgets page shows, per provider:

* The configured limit and reset period
* Current-period spend
* Percentage of the limit used

Spend resets to zero at the start of the next period.

> [!WARNING]
>
> A model with no token cost set counts as **\$0** toward every limit, so its usage is invisible to budgets. When any configured model is unpriced, the Budget page shows a warning at the top listing each one, with a link to set its cost under **Settings** -> **Agent** -> **Models**. Set a cost there to have its usage counted. See [Model costs](https://docs.getnao.io/nao-agent/context-builder/configuration.md#model-costs).

## Alerts and cutoff

Warnings and cutoffs are evaluated against whichever limit is closest to being reached - the project one or the user's own.

* **80% to 100% used**: a banner appears at the top of the chat, warning that the limit is close. It names which budget is running out ("your Anthropic budget" or "your personal Anthropic budget") and when it resets.
* **100% reached**: nao blocks new LLM calls for that provider until the next reset. Someone who hits only their personal limit is blocked on their own; when the project limit is reached, everyone is.
* **On project cutoff**: nao emails the organization admin(s) so they can raise the limit or wait for the reset.

The cutoff applies uniformly across channels: web chat, Slack, Microsoft Teams, Telegram, WhatsApp, Mattermost, and Discord all stop issuing calls to the blocked provider.

## Unblocking

To resume traffic before the period resets, either:

* Raise the limit (project or per-user) on the Budgets page, or
* Switch the default model to another provider that still has budget available.

To reduce spend rather than cap it, tune the per-model thinking effort and max output tokens under [Agent Settings](https://docs.getnao.io/nao-agent/chat/admin/agent-settings.md#model-parameters).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.