# Token Quotas

Cap how many tokens your agents and users can consume, so you can control spend, prevent abuse, and package usage into tiers.

**Path:** Settings → AI Gateway

Quotas cap how many tokens your agents and users can consume. Use them to keep spend within a budget, protect the platform from abuse, and package usage into product tiers.

Quotas are the spend half of the AI Gateway. [High Availability](/user-guides/high-availability/) is the other half: it keeps the agent answering by failing over across your keys, providers, and models when one is throttled or down.

Every quota is a safety limit and a pricing lever at once. Throttling tokens per user, and per user tier, lets you offer the agent to everyone while keeping cost predictable, then lift the ceiling for the users, or the plans, that justify it. If you plan to monetize on AI, quotas are where a free tier ends and a paid one begins.

## Quota reference

All quotas are evaluated concurrently on every request. If any single quota is exceeded, its block behavior triggers.

| Quota | Window | Purpose | End-user experience |
| :--- | :--- | :--- | :--- |
| Agent global | Global | Caps total spend for a specific agent. | Hidden: the agent is removed from the UI until usage falls below the limit. |
| Monthly user | 30-day (rolling) | Enforces long-term per-user billing and usage tiers. | Warn (80%): "You're nearing your monthly usage limit."<br />Block (100%): input disabled, shows the resume date and time. |
| Daily user | 24-hour (rolling) | Stops a single user from exhausting their monthly limit in one day. | Warn (80%): "You're nearing your daily usage limit."<br />Block (100%): input disabled, shows the resume time. |
| Conversation | Per-thread | Bounds the context window of a single chat session. | Warn (80%): "You're nearing the limit for this conversation."<br />Block (100%): input disabled, prompts the user to start a new chat. |
| Burst | 60-second | Rate-limits to prevent automated abuse and spam. | Block: input disabled briefly. "You're sending messages too quickly." |

## How quotas are calculated

Quotas count weighted tokens (input + output), not raw messages. A quota tracks the compute cost of each interaction, so a handful of long, context-heavy turns count the same as many short ones.

## Rolling windows

Daily and monthly quotas use a rolling window rather than a calendar reset. The system looks back exactly 24 hours or 30 days, so a user's oldest usage continuously drops out of the window and access returns gradually. This avoids the traffic spikes that follow a shared midnight or first-of-the-month reset, and gives users a smoother experience than a hard cutoff.

## Configure quotas

Quotas are configured **per agent** (agent scope) from **Settings → Token Quotas**: select an agent, then set its limits for the quota types above. Each agent runs on its own budget, so you can give a high-value agent more headroom than a public one, all from your own cost modeling.

:::tip
Model your quotas against what a user is worth on each plan. Set a conservative daily and monthly cap for the free tier to bound your exposure, then raise the ceiling for paid tiers as an upgrade incentive.
:::

## Related

- [Cost & tokens](/user-guides/analytics/cost-tokens/): the events that record what agents actually spend, by action and model.
- [High Availability](/user-guides/high-availability/): the uptime half of the AI Gateway.
