# Rate Limits

Every API response includes rate-limit headers so your application can track usage and avoid hitting limits.

Anonymous (no key) requests are rate-limited per IP:

* Burst: 60 req/min
* Daily: 1,000 req/day

Keyed requests use the limits defined on your API key's plan (see Service Plans & Pricing).

### 4.1 Rate Limit Headers

| **Header**                  | **Description**                                  |
| --------------------------- | ------------------------------------------------ |
| X-RateLimit-Limit           | The daily request allowance for this key's plan  |
| X-RateLimit-Remaining       | Requests remaining in the current 24-hour window |
| X-RateLimit-Reset           | Unix timestamp (seconds) when the window resets  |
| X-RateLimit-Burst-Limit     | Per-minute burst limit                           |
| X-RateLimit-Burst-Remaining | Remaining burst capacity this minute             |
| Retry-After                 | Seconds to wait; present only on 429 responses   |

### 4.2 TypeScript: Reading Rate Limit Headers

```typescript
const res = await fetch("https://api.diapleo.xyz/v1/protocols", {
  headers: { "X-API-Key": process.env.DIAPLEO_API_KEY! },
});

const remaining = parseInt(res.headers.get("X-RateLimit-Remaining") ?? "0");
const limit = parseInt(res.headers.get("X-RateLimit-Limit") ?? "0");

if (remaining < 100) {
  console.warn(`Only ${remaining}/${limit} requests remaining today.`);
}

// On 429 responses, check Retry-After
if (res.status === 429) {
  const retryAfter = parseInt(res.headers.get("Retry-After") ?? "60");
  console.error(`Rate limited. Retry in ${retryAfter}s`);
}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.diapleo.com/api-reference/overview/rate-limits.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
