Skip to main content
Version: Next

Configure your API Quotas

Lunar Quotas offer a flexible and centralized method for managing and configuring API quotas. These quotas can be both internal or provider-given, allowing users to set precise limits on API consumption. Quota management is defined in a quota.yaml file, shared across all flows within a Lunar Gateway, providing a scalable way to allocate and monitor API usage without shared state issues.

The Quota System is a key feature in this platform, enabling users to define quotas based on specific provider limits, such as monthly, daily, or other intervals. Quotas are dynamically updated as consumption occurs, ensuring real-time management across flows. Future enhancements will expand quota management to include API key generation, allowing sub-keys for specific providers.


Benefits of Lunar Quota Management​

  • Real-time API Usage Monitoring: Automatically updated as quotas are consumed, ensuring accurate real-time usage statistics.
  • Granular Control: Ability to set quotas based on URLs, headers, and user groups. Nested quotas allow for more detailed control over specific API resources.
  • Scalability: Easily manage and track quotas across multiple API flows and user environments.

Quota Example​

Here’s an example of a quota configuration defined in a quota.yaml file:

/etc/lunar-proxy/quotas/{fileName}.yaml
quota:
id: MyQuota
filter:
url: api.website.com/*
strategy:
fixed_window:
max: 100
interval: 1
interval_unit: minute
CTRL + M