> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/ai-workbench-qore/console/agent-builder/deploy/guardrails/credit-usage.md).

# Credit usage

Cap the credits, tokens, or dollars an agent can use per period or per conversation.

The **Credit Usage Limit** guardrail caps what one agent can consume. Set a limit in credits, tokens, or dollars, over a day, a week, a month, or a single conversation. When the agent reaches a limit, its next model call is refused until the period resets or a new conversation starts.

Open it from **Agent Config → Guardrails**: select the **Credit Usage Limit** row.

### At a glance <a href="#at-a-glance" id="at-a-glance"></a>

* **Where:** Agent Config → Guardrails → **Credit Usage Limit**.
* **Scope:** one agent. Each agent has its own limits.
* **What happens at a limit:** the next model call isn't made, and the run is refused.
* **Related limits:** an account-wide limit and the account's alerts are set in [Usage Limits](https://docs.uptiq.ai/ai-workbench-qore/control-center/cost-control/usage-limits.md). The strictest limit that applies wins.

### Add a limit <a href="#add-a-limit" id="add-a-limit"></a>

The **Credit Usage** window opens under the line `Control how many credits, tokens or dollars this agent can consume`. A **How it works** note explains `Cap the credits, tokens or dollars this agent can consume per period or per conversation. Executions beyond a cap are rejected until the period resets or a new conversation starts.` Select the **×** on the note to dismiss it. Until you add a limit, the window reads `Nothing configured yet`.

### The limits table <a href="#the-limits-table" id="the-limits-table"></a>

Once you add limits, the window lists them in a table. An agent can have several at once, for example a daily limit and a weekly limit.

![](https://1326225582-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0qmgQjJ5aArDTj2ACFHG%2Fuploads%2Fgit-blob-b385264b7a7cf7c5ef945d05f122bd8d5f65c0b3%2Fcredit-usage-limits.png?alt=media)

| Column     | What it holds                                                                                                                                             |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Period** | The duration, with when it resets beneath it: `Resets every day at 00:00 UTC` for a daily limit, and `Resets every Monday at 00:00 UTC` for a weekly one. |
| **Value**  | The cap, written in the limit's unit: `12,000 credits` for credits, or `$225.00` for dollars.                                                             |
| **Type**   | The kind of limit. A **Hard Limit** refuses the agent's next model call when it is reached.                                                               |
| (menu)     | The `⋮` menu at the end of the row has **Edit** and **Delete**.                                                                                           |

**Add Limit**, at the bottom left, opens the form below. **Done**, at the bottom right, closes the window. Limits are listed in the table as soon as you add them.

1. Select **Add Limit**. The **Add Usage Limit** form opens.
2. Choose a **Duration**: **Daily**, **Weekly**, **Monthly**, or **Per Conversation**. It starts on Daily.
3. Choose a **Limit Type**. It starts on **Credits**.
4. Enter the **Limit**, for example `10000`. The field suggests `e.g. 10000`.
5. Select **Add**, then **Done**. Select **Cancel** to close the form without adding anything.

The form validates the limit as you type. A credits limit can't exceed 1,000,000 credits. Above that, the field turns red and reads `Cannot exceed 1,000,000 credits`.

| Duration                           | Limit types you can choose               | What it counts                                          |
| ---------------------------------- | ---------------------------------------- | ------------------------------------------------------- |
| **Daily**, **Weekly**, **Monthly** | **Credits**, **Dollars ($)**             | What the agent has used since the period started        |
| **Per Conversation**               | **Credits**, **Tokens**, **Dollars ($)** | What the agent has used so far in that one conversation |

The **Limit Type** list offers **Credits** and **Dollars ($)** for a period, and adds **Tokens** for **Per Conversation**. **Tokens** limits are available only for **Per Conversation**. For a period, use credits or dollars. A token count adds input, output, and cached tokens for every model call in the conversation. Token limits take whole numbers.

Limits that were saved before this release keep working, and their type is **Credits**.

### Edit or delete a limit <a href="#edit-or-delete-a-limit" id="edit-or-delete-a-limit"></a>

Open a row's `⋮` menu and select **Edit** to change the limit, or **Delete** to remove it. A deleted limit stops applying to the agent.

### What happens at a limit <a href="#what-happens-at-a-limit" id="what-happens-at-a-limit"></a>

Before each model call, the platform compares the agent's usage with each limit. If usage has reached the limit, the call is refused with a message of the form `The <period> <unit> usage limit configured for this agent has been reached: <used> used of the <allowed> allowed.` The period and the unit match the limit that was reached.

Because the check runs before the call, a call that starts just under the limit can finish over it. The next call is refused.

### Notes and limitations <a href="#notes-and-limitations" id="notes-and-limitations"></a>

* **A conversation that began before per-conversation tracking was added is never capped.** A new conversation starts counting from zero.
* **The check doesn't block a call it can't attribute.** If the platform can't tell which agent or billing account a call belongs to, the call goes through.
* **Per-conversation limits need a conversation.** A run with no conversation isn't subject to a Per Conversation limit.

### Related <a href="#related" id="related"></a>

<table data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-card-target data-type="content-ref">Link</th></tr></thead><tbody><tr><td><strong>Guardrails</strong></td><td>All the guardrails you can set on an agent.</td><td><a href="https://docs.uptiq.ai/ai-workbench-qore/console/agent-builder/deploy/guardrails.md">Guardrails</a></td></tr><tr><td><strong>Usage Limits</strong></td><td>Account-wide limits and alerts.</td><td><a href="https://docs.uptiq.ai/ai-workbench-qore/control-center/cost-control/usage-limits.md">Usage limits</a></td></tr></tbody></table>


---

# 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.uptiq.ai/ai-workbench-qore/console/agent-builder/deploy/guardrails/credit-usage.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.
