Api
Rate Limiting
Endpoints for managing rate limits and token buckets.
Check rate limits or refill tokens
Authorization
ApiKeyAuth X-Borrow-Api-Key<token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.borrow.dev/v1/limiter" \ -H "Content-Type: application/json" \ -d '{ "userId": "user_123", "key": "login", "action": "check", "limiters": [ { "type": "fixed", "maxRequests": 10, "interval": "minute" } ] }'{
"result": "success",
"message": "string",
"tokensLeft": 0
}{
"result": "error",
"message": "string",
"error": "UNAUTHORIZED"
}{
"result": "error",
"message": "string",
"error": "UNAUTHORIZED"
}{
"result": "error",
"message": "string",
"error": "UNAUTHORIZED"
}