*This page
applies to **Apigee** and **Apigee hybrid**.*


*View [Apigee Edge](https://docs.apigee.com/api-platform/get-started/what-apigee-edge) documentation.*
![](https://fonts.gstatic.com/s/i/googlematerialicons/help/v13/gm_grey-24dp/1x/gm_help_gm_grey_24dp.png)

To maintain performance and availability across a diverse base of client
apps, it's critical to maintain app traffic within the limits of the capacity
of your APIs and backend services. It's also important to ensure that apps
don't consume more resources than permitted.

Apigee provides the following policies that enable you to optimize traffic management
to minimize latency for apps while maintaining the health of backend services.
Each policy type addresses a distinct aspect of traffic management. In some
cases, you might use both policy types in a single API proxy.

- General-purpose policies
  - [SpikeArrest policy](https://docs.cloud.google.com/apigee/docs/api-platform/develop/rate-limiting.md.txt#spikearrest)
  - [Quota policy](https://docs.cloud.google.com/apigee/docs/api-platform/develop/rate-limiting.md.txt#quota)
- [Specialized rate-limiting policies](https://docs.cloud.google.com/apigee/docs/api-platform/develop/rate-limiting.md.txt#specialized-rate-limiting)
  - [LLMTokenQuota policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/llm-token-quota-policy.md.txt)
  - [PromptTokenLimit policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/prompt-token-limit-policy.md.txt)

## SpikeArrest policy

The SpikeArrest policy protects against traffic surges. This policy limits
the number of requests processed by an API proxy and sent to a backend,
protecting against performance lags and downtime.

This policy should be used to prevent sudden traffic bursts caused by
malicious attackers attempting to disrupt a service using a denial-of-service
(DOS) attack or by buggy client applications.

See [SpikeArrest policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/spike-arrest-policy.md.txt).

## Quota policy

This policy enforces consumption limits on client apps by maintaining a
distributed 'counter' that tallies incoming requests. The counter can tally
API calls for any identifiable entity, including apps, developers, API keys,
access tokens, and so on. Usually, API keys are used to identify client apps.
This policy is computationally expensive so, for high-traffic APIs, it should
configured for longer time intervals, such as a day or month. This policy
should be used to enforce business contracts or SLAs with developers and
partners, rather than for operational traffic management.

See [Quota policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/quota-policy.md.txt).

## Specialized rate-limiting policies

In addition to the general-purpose Quota and SpikeArrest policies,
Apigee also provides the LLMTokenQuota policy and the
PromptTokenLimit policy for APIs that interact with Large Language Models
(LLMs). These policies allow you to enforce quotas and rate limits on the
number of tokens used, which can be a more granular way to control costs and
usage than simple request counting.

See:

- [LLMTokenQuota policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/llm-token-quota-policy.md.txt)
- [PromptTokenLimit policy](https://docs.cloud.google.com/apigee/docs/api-platform/reference/policies/prompt-token-limit-policy.md.txt)