Skip to content

Implement subscription API rate limiting and usage metering#461

Open
Itodo-S wants to merge 1 commit into
Smartdevs17:mainfrom
Itodo-S:issue-369-rate-limiting-metering
Open

Implement subscription API rate limiting and usage metering#461
Itodo-S wants to merge 1 commit into
Smartdevs17:mainfrom
Itodo-S:issue-369-rate-limiting-metering

Conversation

@Itodo-S
Copy link
Copy Markdown
Contributor

@Itodo-S Itodo-S commented May 27, 2026

Description

Build a metering system that tracks API usage per subscription tier and enforces rate limits with soft warnings and hard caps.

Changes

  • Usage metering per API key with hourly/daily/monthly counters with automatic reset
  • Tier-based rate limits (free: 100/h, pro: 1000/h, enterprise: custom) with burst and concurrent limits
  • Soft limit warning at 80% and 95% usage thresholds
  • Hard limit enforcement with 429 response including retry-after headers
  • Usage analytics dashboard data with p95/p99 latency, error rates, and top endpoints
  • Automatic tier upgrade recommendation on sustained overuse

Files Changed

  • backend/services/rateLimitingService.ts - Core rate limiting service with RateLimitingService class
  • backend/services/index.ts - Service export
  • src/types/rateLimiting.ts - Rate limiting types, tier configurations, and constants

Closes #369

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Itodo-S Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Copy link
Copy Markdown
Owner

@Itodo-S merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement subscription API rate limiting and usage metering

2 participants