Enforce monetization limits by attaching policies to API proxies associated with a monetized API product as described in the following sections.
Adding an authentication policy
Apigee monetization uses the VerifyAPIKey or VerifyAccessToken policy to determine if an incoming request is monetizable by checking for the active published rate plan.
Attach the VerifyAPIKey policy or VerifyAccessToken policy to an API proxy in one of the following ways:
When creating an API proxy using the Create proxy wizard, select API Key or OAuth 2.0 in the Security: Authorization section on the Common policies page. For example:
When developing an API proxy, attach the VerifyAPIKey policy or VerifyAccessToken policy to the request flow as the first policy in the API proxy PreFlow. For example:
Attach the MonetizationLimitsCheck policy to API proxies to enforce developer subscriptions to the API product. Specifically, the policy is triggered if the app developer accessing the API has not purchased a subscription to the associated API product. In this case, the MonetizationLimitsCheck policy raises a fault and blocks the API call.
If no monetization rate plan exists for the API product fetched during the proxy call execution, the product is deemed non-monetized, the MonetizationLimitsCheck policy does not fetch any further data, and the policy has no effect.
When you attach the MonetizationLimitsCheck policy to an API proxy, the mint.limitscheck.* and mint.subscription_* flow variables are populated, as described in Debugging the MonetizationLimitsCheck policy and the mint flow variable reference.
Attach the MonetizationLimitsCheck policy to an API proxy in one of the following ways:
When creating an API proxy using the Create proxy wizard, select Enforce monetization limits on the Common policies page, as shown in the following figure.
When developing an API proxy, attach the MonetizationLimitsCheckPolicy to the request flow in the API proxy PreFlow after the VerifyAPIKey or VerifyAccessToken policy, as shown in the following figure.
A quota defines the number of requests allowed for an API product over a given time period. To enforce quotas for monetization, it is recommended that you set the quota value when creating an API product.
Defining a quota value for an API product does not automatically enforce restrictions on the number of calls that can be made through the API product. You must also add Quota policies to the API proxies that are referenced by the API product to ensure the quota value defined at the API product level is enforced.
Attach the Quota policy to an API proxy in one of the following ways:
When creating an API proxy using the Create proxy wizard, select Impose quotas per app in the Quotas section on the Common policies page, as shown in the following figure.
When developing an API proxy, attach the Quota policy to the request flow in the API proxy PreFlow after the VerifyAPIKey or VerifyAccessToken policy, as shown in the following figure.
Edit the Quota policy to enable the <UseQuotaConfigInAPIProduct> element to use the quota configuration defined at the API product level.
When you attach the Quota policy to an API proxy, the ratelimit.* flow variables are populated, as described in Debugging the Quota policy and the Quota policy flow variables reference.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-24 UTC."],[[["This documentation applies to both Apigee and Apigee hybrid platforms, focusing on enforcing monetization limits within these environments."],["Monetization in Apigee utilizes the VerifyAPIKey or VerifyAccessToken policies to identify if an incoming request is monetizable based on the active published rate plan."],["The MonetizationLimitsCheck policy is used to enforce developer subscriptions to API products, triggering a fault and blocking API calls if a subscription is absent."],["Quota policies can be attached to API proxies to enforce request limits for API products, with the option to configure quotas at the API product level for greater control."],["The Quota policy requires the `\u003cUseQuotaConfigInAPIProduct\u003e` element to utilize the defined API product quota configuration, which will take precedence over any other configured values in the Quota policy itself."]]],[]]