> For the complete documentation index, see [llms.txt](https://docs.duplocloud.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplocloud.com/docs/advanced-topics/access-control/quotas.md).

# Quotas

Quotas let administrators set cost limits on LLM usage. A quota definition sets the limit and the period it covers, and a quota mapping applies it to a context: each ticket, each user, a whole workspace, or the entire platform.

The limit is checked before each message is sent to the agent. Once spend for the period reaches the limit, the agent doesn't process the message and the ticket shows an error naming the limit, the amount used, and when it resets. The message that crosses the limit still completes, so recorded spend can end up slightly above the limit.

Daily limits reset at UTC midnight. Monthly limits reset on the first day of the next month (UTC).

***

## Quota Definitions

Go to **AI Admin → Access Control → Quota → Quota Definition**. The cards at the top summarize every definition: how many there are, how many no mapping uses yet (**Not applied**), the highest limit, and the most recently modified. The table lists each definition's name, description, period type, and USD limit.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-0681f608fd901bae11903808bbec58059390ba34%2Fquota-step-01-definition-list.png?alt=media)

### Add a Quota Definition

Click **+ Add**. Fill in the fields:

* **Name** — a unique name for the quota policy
* **Description** — optional
* **Period Type** — **Daily** or **Monthly**, the window the limit covers
* **Limit (USD)** — the maximum spend allowed within the period

Click **Create**.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-8fd9bf295226479669fb2e1b21b67e251420453f%2Fquota-step-02-add-definition.png?alt=media)

A definition does nothing on its own until a mapping applies it. A definition can't be deleted while a mapping still references it — delete the mapping first.

***

## Quota Mappings

Click the **Quota Mapping** tab. A mapping binds a quota definition to a context and an **Apply To** value, which decide what activity the limit counts. The table shows each mapping's quota definition, context, what it applies to, and its target workspaces.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-f1d77ab9fc1962ece17f48235393b7b2e66e08c4%2Fquota-step-03-mapping-list.png?alt=media)

### Add a Quota Mapping

Click **+ Add**. Fill in the fields:

* **Name** — a label for this mapping
* **Description** — optional
* **Quota Definition** — the definition to apply
* **Context** — **Workspace** or **System**
* **Target Workspace(s)** — one or more workspaces the mapping applies to (shown only when Context is Workspace)
* **Apply To** — what the limit tracks. The options depend on Context:

| Context   | Apply To                          | Meaning                                                            |
| --------- | --------------------------------- | ------------------------------------------------------------------ |
| System    | All Workspaces And Users          | One limit on all spend, platform-wide                              |
| System    | All Workspaces                    | A separate limit for each workspace, platform-wide                 |
| System    | All Users                         | A separate limit for each user, counted across all workspaces      |
| Workspace | Above Selected Workspaces         | A shared limit on all activity in each selected workspace          |
| Workspace | Per User In Selected Workspaces   | A separate limit for each user, within the selected workspace(s)   |
| Workspace | Per Ticket In Selected Workspaces | A separate limit for each ticket, within the selected workspace(s) |

Click **Create**.

Only one active mapping is allowed for each combination of context, Apply To, and period type — per workspace for Workspace mappings, and platform-wide for System mappings.

### Ticket Quota

When **Apply To** is **Per Ticket In Selected Workspaces**, each ticket in the selected workspaces has its own spend counter. One ticket reaching the limit doesn't affect other tickets in the same workspace.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-d7481dad028e3f92940c543597f8ef00bebd031a%2Fquota-step-04-mapping-per-ticket.png?alt=media)

Create a ticket in a target workspace and send a request. The agent answers as usual, and each reply shows its cost.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-774e0c5b477d1884f153128f060ab49bc33d5bb5%2Fquota-step-05-ticket-reply.png?alt=media)

Once the ticket's spend for the period reaches the limit, the next message is blocked. The error names the ticket, the amount used, and when the limit resets.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-d786a0072b5b6379fe7fb78fb291f509cc2e90a5%2Fquota-step-06-ticket-blocked.png?alt=media)

A new ticket in the same workspace starts with a fresh counter and works normally.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-456bb648347bd2aea2106fa761dc1480732bf20c%2Fquota-step-07-new-ticket.png?alt=media)

### Workspace Quota

When **Apply To** is **Above Selected Workspaces**, all activity in each selected workspace counts toward that workspace's shared limit, across every ticket and user. Once the limit is reached, new requests in that workspace are blocked, with an error naming the workspace, the amount used, and the reset time. Other workspaces are unaffected.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-8110bf27b684ee66e4c445adc99254ab5e75f6d1%2Fquota-step-08-mapping-workspace.png?alt=media)

### User Quota

Set **Apply To** to **Per User In Selected Workspaces** (Context: Workspace) or **All Users** (Context: System) to give each user their own spend counter. One user hitting their limit doesn't affect other users, including others active in the same workspace or ticket. With **Per User In Selected Workspaces**, a user's spend is counted per workspace; with **All Users**, it's counted across all workspaces.

### System Quota

When **Context** is **System**, the quota applies across the whole platform rather than to chosen workspaces. Set **Apply To** to **All Workspaces And Users** to enforce a single limit on all spend, or to **All Workspaces** or **All Users** to give every workspace or every user its own limit platform-wide.

![](https://2471407984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F68cb0s9ce5UIUKWPuYs8%2Fuploads%2Fgit-blob-7b6ddb38ab05a9671d27a02de65aa2942fbb91c4%2Fquota-step-09-mapping-system.png?alt=media)

**All Workspaces** and **All Users** act as platform defaults. A workspace that has its own **Above Selected Workspaces** mapping uses that instead of **All Workspaces**, and a workspace with its own **Per User In Selected Workspaces** mapping uses that instead of **All Users**. **All Workspaces And Users** always applies in addition to any other limit.

Once a System limit is reached, every matching request is blocked, whichever workspace, user, or ticket it comes from.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.duplocloud.com/docs/advanced-topics/access-control/quotas.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
