> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://doc.enterpriserouter.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://doc.enterpriserouter.com/_mcp/server.

# Rate Limits & Budgets

Enterprise Router enforces rate limits and budget controls at both the key and organization level.

## Per-key rate limits

Each proxy key can have a **requests per minute (RPM)** limit. When the limit is exceeded, the gateway returns `429 Too Many Requests` with `"error": "rate_limited"`.

Set this when creating or editing a key in the dashboard, or via the management API.

## Organization rate limits

Organization-wide RPM limits are configured through budget configs. These apply across all keys in the org. When exceeded, the gateway returns `429` with `"error": "organization_rate_limited"`.

## Rate limit headers

When a key has a rate limit configured, the gateway includes these headers in every response:

| Header                  | Description                              |
| ----------------------- | ---------------------------------------- |
| `X-RateLimit-Limit`     | The RPM limit for this key               |
| `X-RateLimit-Remaining` | Requests remaining in the current window |
| `X-RateLimit-Reset`     | Unix timestamp when the window resets    |

For org-level limits, additional headers are included:

| Header                      | Description                                      |
| --------------------------- | ------------------------------------------------ |
| `X-RateLimit-Org-Limit`     | The org-wide RPM limit                           |
| `X-RateLimit-Org-Remaining` | Org requests remaining                           |
| `X-RateLimit-Scope`         | Set to `organization` on org-level 429 responses |

## Budget controls

Budget configs let you set spending limits for your organization:

### Hard budget

When the organization's spend reaches the **max budget** for the current period, all requests are denied with `403 budget_exceeded`.

### Soft budget

When spend reaches the **soft budget** threshold, requests are still allowed but the gateway adds a warning header:

```
X-Budget-Warning: approaching_limit
```

Use this to trigger alerts in your application before hitting the hard limit.

### Budget periods

Budgets reset automatically based on the configured duration:

| Period    | Resets at                           |
| --------- | ----------------------------------- |
| `daily`   | Midnight UTC                        |
| `weekly`  | Start of week (Sunday midnight UTC) |
| `monthly` | First of the month, midnight UTC    |
| `never`   | Cumulative, never resets            |

## Per-key spend limits

Individual keys can also have spend limits:

* **Spend limit (\$)** — maximum dollar amount this key can spend
* **Reset period** — daily, weekly, monthly, or never

When a key exceeds its spend limit, requests are denied with `403 spend_exceeded`.

## Credit balance

Your organization maintains a credit balance. Every request deducts from this balance based on token usage and model pricing. When credits run out, requests are denied with `403 insufficient_credits`.

Purchase credits in **Settings > Billing** in your dashboard.