rate-limit-proAdvanced rate limiting with tiered controls and quota management
Install via ClawdBot CLI:
clawdbot install raghulpasupathi/rate-limit-proAdvanced rate limiting with multiple tiers and quota management.
class RateLimiter {
constructor(options = {}) {
this.tiers = options.tiers || {
free: { requests: 10, window: 60000 }, // 10 req/min
basic: { requests: 100, window: 60000 },
pro: { requests: 1000, window: 60000 }
};
this.requests = new Map();
}
checkLimit(userId, tier = 'free') {
const tierConfig = this.tiers[tier];
if (!tierConfig) {
return { allowed: false, reason: 'invalid_tier' };
}
const now = Date.now();
const userRequests = this.requests.get(userId) || [];
// Remove old requests outside window
const validRequests = userRequests.filter(
timestamp => now - timestamp < tierConfig.window
);
// Check if under limit
if (validRequests.length >= tierConfig.requests) {
const oldestRequest = validRequests[0];
const resetIn = tierConfig.window - (now - oldestRequest);
return {
allowed: false,
reason: 'rate_limit_exceeded',
limit: tierConfig.requests,
remaining: 0,
resetIn: Math.ceil(resetIn / 1000)
};
}
// Add current request
validRequests.push(now);
this.requests.set(userId, validRequests);
return {
allowed: true,
limit: tierConfig.requests,
remaining: tierConfig.requests - validRequests.length,
resetIn: Math.ceil(tierConfig.window / 1000)
};
}
resetUser(userId) {
this.requests.delete(userId);
}
getStats(userId) {
const userRequests = this.requests.get(userId) || [];
return {
totalRequests: userRequests.length,
oldestRequest: userRequests[0] || null,
newestRequest: userRequests[userRequests.length - 1] || null
};
}
}
// Export for OpenClaw
module.exports = { RateLimiter };
const limiter = new skills.rateLimitPro.RateLimiter({
tiers: {
free: { requests: 10, window: 60000 },
pro: { requests: 1000, window: 60000 }
}
});
const result = limiter.checkLimit('user123', 'free');
if (result.allowed) {
// Process request
} else {
console.log(`Rate limit exceeded. Reset in ${result.resetIn}s`);
}
{
"tiers": {
"free": { "requests": 10, "window": 60000 },
"basic": { "requests": 100, "window": 60000 },
"pro": { "requests": 1000, "window": 60000 }
}
}
Generated Mar 1, 2026
This skill can enforce tiered API usage limits for SaaS customers, ensuring fair resource allocation. For example, free-tier users get 10 requests per minute, while paid tiers like 'pro' receive 1000 requests per minute, preventing abuse and maintaining service quality.
It helps control user actions such as posting or messaging to prevent spam and server overload. By setting different limits for new users (free tier) and verified users (pro tier), it enhances platform stability and user experience.
This skill manages request rates during high-traffic sales events like Black Friday, limiting checkout attempts per user to prevent bot abuse and ensure smooth transactions. Tiers can prioritize premium customers with higher limits.
It regulates how often IoT devices send data to a cloud server, preventing network congestion and server overload. Different device tiers (e.g., basic vs. pro) can have customized limits based on subscription plans.
The skill throttles player requests in online games to prevent cheating and server crashes. Free players might have lower request limits, while premium players enjoy higher allowances for smoother gameplay.
Offer a free tier with basic rate limits (e.g., 10 requests/min) to attract users, then upsell to paid tiers (e.g., 1000 requests/min) for advanced features. This drives conversions by monetizing heavy usage.
Charge customers based on their usage tiers, with higher request limits costing more per month. This model scales revenue with customer demand and encourages efficient API consumption.
Sell customized rate-limiting solutions to large businesses with specific tier configurations and support. This includes high-volume tiers and dedicated management tools for enterprise clients.
💬 Integration Tip
Start by defining clear tier configurations in the options object, and use the checkLimit method in your API middleware to enforce limits before processing requests.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.