# Budgets

Budgets let you control how much your project spends on AI requests. You can set spending limits at different levels for the whole project, per user, or per API key and choose daily, weekly, or monthly time windows. When a limit is reached, further requests are blocked until the window resets.

***

### Budget Scopes

A budget rule always targets a specific **scope** that determines what it applies to:

| Scope                      | What It Controls                                                    |
| -------------------------- | ------------------------------------------------------------------- |
| **Project**                | Total combined spend across the entire project                      |
| **User - Each user**       | A shared limit applied individually to every user in the project    |
| **User - Specific user**   | A limit for one specific user                                       |
| **API Key - Each API key** | A shared limit applied individually to every API key in the project |
| **API Key - Specific key** | A limit for one specific API key                                    |

{% hint style="info" %}
**"Each user"** and **"Each API key"** rules are especially useful as defaults. For example, setting an "Each user" monthly limit of €50 means every user in your project gets their own individual €50/month allowance without having to create a rule for each person.#
{% endhint %}

{% hint style="warning" %}
**DEPRECATION NOTE** If you created your API key before the 1st of May 2026, you need to rotate it (delete and recreate) for API key-level budget tracking to work correctly. Keys created after that date work automatically.
{% endhint %}

***

### Budget Periods

Each rule uses one of three time windows. Spend counters reset automatically at the start of each window (UTC time):

| Period      | Resets At                   |
| ----------- | --------------------------- |
| **Daily**   | Midnight UTC                |
| **Weekly**  | Monday 00:00 UTC            |
| **Monthly** | 1st of the month, 00:00 UTC |

You can combine multiple periods on the same target. For instance, you could set both a daily limit of €5 and a monthly limit of €100 for a user.

***

### Viewing Budget Rules

To view the rules defined you need to:

1. Navigate to **Settings**
2. Select the [Budgets](https://cortecs.ai/userArea/userProfile?tab=budgets) tab.

The Budgets tab in your project settings shows all active budget rules as cards. Each card displays:

* A **scope** (blue for Project, purple for User, amber for API Key)
* The **target** (e.g. Project, a user's name, or an API Key)
* The **period** (Monthly, Weekly, or Daily)
* The **current limit** in EUR
* A **utilization bar** showing how much of the budget has been used

<figure><img src="/files/Fa0BTngAbqPRIRx1z9bj" alt=""><figcaption></figcaption></figure>

***

### Creating a Budget Rule

{% hint style="warning" %}
Only project administrators can create, edit, or delete budget rules. Regular users can view the rules that apply to them and their own utilization.
{% endhint %}

1. Click the **"Add budget rule"** button at the bottom of the budget rules list
2. Configure the **Target** section:
   * **Scope**: Choose Project, User, or API Key
   * **User** *(appears for User and API Key scopes):* Select a specific user, or leave as "Each user" / "Each API key" to create a default rule
   * **API Key** *(appears when a specific user is selected under API Key scope):* Pick one of the user's API keys
3. Configure the **Limit** section:
   * **Period**: Choose Daily, Weekly, or Monthly
   * **Amount (EUR)**: Enter the spending cap (minimum €0.01)
4. Click **Create**

If a rule already exists for the same target, the new period will be added alongside existing ones rather than replacing them.

<figure><img src="/files/7km0k5WuhcLwoes0zHDx" alt=""><figcaption></figcaption></figure>

***

### Editing a Budget Rule

To update an existing rule's limit:

1. Change the **EUR amount** in the input field on the rule card
2. Click **Save**

The new limit takes effect immediately. Current utilization is not reset, only the cap changes.

***

### Deleting a Budget Rule

To remove a rule:

1. Click the **trash icon** on the rule card
2. The rule is removed immediately

If the rule was the last period on a target (e.g. you delete a user's only monthly limit), the entire budget configuration for that target is cleaned up automatically.

***

### What Happens When a Budget Is Exceeded

When a request would cause spending to exceed a budget limit:

* The request is **blocked** with an error message indicating which budget was exceeded
* The message includes the **time remaining** until the budget window resets
* Once the window resets (e.g. a new day, week, or month), spending is allowed again

{% hint style="info" %}
Budget limits are enforced across all applicable scopes. A request can be blocked by any matching rule for example, even if a user's personal budget has room, the request will be blocked if the project-wide budget is exhausted.
{% endhint %}

***

### Visibility for Non-Admin Users

Regular (non-admin) users can see:

* ✅ Project-wide budget rules and utilization
* ✅ Default rules ("Each user" / "Each API key") with **their own** utilization only
* ✅ Budget rules that specifically target them

They **cannot** see budget rules or utilization data for other users.

***

### Automatic Cleanup

Budget rules are automatically removed when their target no longer exists:

* Removing a **user** from the project deletes all budget rules targeting that user
* Deleting an **API key** deletes the budget rule for that key
* Deleting a **project** removes all associated budget rules


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cortecs.ai/features/budgets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
