Create a rate limit

Create a new rate limit with dimension filters.

Rate limits control how many requests can be made within a time window. You can apply rate limits to specific customers, models, event types, or any combination using dimension filters.

POST
/rate-limits
AuthorizationBearer <token>

Project API key

In: header

Request Body

application/json

name*string

Human-readable name for the rate limit

Length1 <= length
dimensionFilters?

Dimension filters that determine which requests match this rate limit

Default{}
limitValue*integer

Maximum number of requests allowed in the time window

Range0 < value
window*string

Time window for the rate limit

Value in"second" | "minute" | "hour"
enabled?boolean

Whether the rate limit is enabled

Defaulttrue

Response Body

application/json

application/json

application/json

curl -X POST "https://api.limitry.com/v1/rate-limits" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "limitValue": 0,    "window": "second"  }'
{
  "id": "rl_abc123",
  "projectId": "proj_xyz",
  "name": "Customer API limit",
  "dimensionFilters": {
    "customer_id": "cust_123"
  },
  "limitValue": 100,
  "window": "1h",
  "enabled": true,
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
{
  "error": "Invalid request"
}
{
  "error": "Invalid or missing API key"
}