> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Rate Limiting

> Protecting your backends and managing quotas

Better Data Cloud provides sophisticated rate limiting to protect your commerce infrastructure from being overwhelmed by AI agents or malicious actors.

## Multi-Layer Protection

We apply rate limits at three different levels:

### 1. Account Level

Enforced based on your [Subscription Tier](/hosted/billing). This protects the Better Data infrastructure.

### 2. Provider Level (Guardrails)

You can set limits on specific LLM providers. For example, you might want to allow `Claude` to make 500 calls/hr but limit `OpenAI` to 200 calls/hr.

### 3. User / Session Level

Prevent a single user or bot from monopolizing your resources.

* **Default**: 20 calls per session per minute.
* **Customizable**: You can increase or decrease this in the dashboard.

## Response Headers

Every request to the Hosted Gateway includes headers indicating your current status:

```
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1704456000
```

## Handling 429 Errors

When a limit is reached, the gateway returns:

```json theme={null}
{
  "error": "rate_limit_exceeded",
  "message": "You have exceeded your hourly quota. Upgrade to a higher tier for more capacity.",
  "retry_after": 300
}
```

We recommend that your client application or LLM adapter handles these errors gracefully by notifying the user or retrying after the `retry_after` duration.
