> ## Documentation Index
> Fetch the complete documentation index at: https://docs.throttlr.yashjejurkar.me/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Overview of the Throttlr REST API.

## Base URL

```
https://repoapi-production-fcf8.up.railway.app
```

## Authentication

All SDK-facing endpoints use API key authentication via the `x-api-key` header:

```http theme={null}
x-api-key: sk_live_your_key_here
```

All dashboard-facing endpoints (projects, rules, logs) use JWT Bearer tokens:

```http theme={null}
Authorization: Bearer <jwt_token>
```

***

## Rate Limit Check Endpoint

This is the primary endpoint the SDK calls internally.

```http theme={null}
POST /sdk/check
```

**Request body:**

```json theme={null}
{
  "identifier": "user_123",
  "rule": "send_email"
}
```

**Response (200 Allowed):**

```json theme={null}
{
  "allowed": true,
  "count": 3,
  "limit": 10,
  "remaining": 7,
  "rule": "send_email",
  "identifier": "user_123"
}
```

**Response (429 Blocked):**

```json theme={null}
{
  "allowed": false,
  "count": 10,
  "limit": 10,
  "remaining": 0,
  "rule": "send_email",
  "identifier": "user_123"
}
```

***

## Error Format

All errors follow this shape:

```json theme={null}
{
  "error": {
    "code": "RULE_NOT_FOUND",
    "message": "No rule named 'send_emial' found for this tenant"
  }
}
```

| HTTP Status | Meaning                           |
| ----------- | --------------------------------- |
| `400`       | Missing or invalid request fields |
| `401`       | Missing or invalid API key        |
| `404`       | Rule not found                    |
| `429`       | Rate limit exceeded               |
| `500`       | Internal server error             |
