API-Based Quota
API-Based Quota is used to limit the number of requests to a given API in a given time period.
When the number of messages defined by the API Based Quota policy is reached, no new requests will be directed to the Backend API until the specified time is completed. Thus, the maximum number of messages in a certain period of time to be sent to the Backend API is controlled.
For example, if the total number of API requests is specified as 1.000.000/day (1.000.000 requests per day) and the number of messages exceeds 1.000.000 messages per day, the client will be returned with an error message stating that too many requests were made, along with the HTTP status code 403.
The difference between the API Based Quota policy and the API Based Throttling policy is the time period in which the limitation is applied. For a throttling policy, the timeframe can be seconds or minutes, while for a quota policy the timeframe can be hours, days, or months.
The picture below shows the policy settings:
The policy fields are shown in the table below.
Field | Description |
---|---|
Name | The name can be written to facilitate the use and management of the policy. You will need this name during the management and selection of policies. |
Description | An optional description of the policy that may be useful for usage and management activities. |
Apply by | A variable can be selected for this policy to work over a certain variable. It is optional. |
Quota Count | It is the maximum number of messages that can be sent to the Backend API within the time given by the Quota Interval. |
Interval Time Amount | The numeric value specifying the duration of the throttling window in the chosen time unit. |
Interval Time Unit | The time unit (e.g., seconds, minutes) used to define the throttling window for API request limits. |
Interval Window Type | The time interval method used for API rate limiting (fixed or sliding). |
The timeout duration for the cache connection is specified. | |
Action for Cache Connection Error | Specifies the action to be taken if the policy has a connection problem with the cache server. |
Daily quota information is kept in the cache and quota information is reset to UTC timezone.
If you want the starting time of the daily changing quota to be reset according to your local timezone, you can add the CACHE_QUOTA_TIMEZONE value to the additional variables of the cache server in the server settings on the administration page.
You can visit the Policies page for the details of the Conditions and Error Message Customization panels.
Throttling and quota usage differences can be explored by visiting the A Comprehensive Guide to Rate Limiting, Throttling, and Quota Management page.