# How do the quota settings on an API product interact with quota policies in an API proxy?

**URL:** <https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852>\
**Category:** Apigee\
**Tags:** api-runtime\
**Created:** [February 13, 2015, 1:07pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852 "2015-02-13T13:07:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonesfloyd](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jonesfloyd](https://discuss.google.dev/u/jonesfloyd)\
**Post date:** [February 13, 2015, 1:07pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/1 "2015-02-13T13:07:25Z")

</div>

I can add quota settings to an API product, and I can also add quota policies to an API proxy. How do those settings interact? Also, how do I reference quota settings on the product in a quota policy?

---

<div class="post-metadata">

**Author:** ![mdunker](https://d3byx8b92xw3lq.cloudfront.net/user_avatar/discuss.google.dev/mdunker/32/24334_2.png) [@mdunker](https://discuss.google.dev/u/mdunker)\
**Post date:** [February 13, 2015, 7:19pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/2 "2015-02-13T19:19:30Z")

</div>

Good question, this brings up a common misconception about quota settings on an API product.

API products have a set of fields called “Quota” that allow you to configure how many requests per number of time periods (like 10 requests per 1 second) you want to allow. Just configuring this does NOT enforce quotas though!

Quotas are only enforced by adding a quota policy into your proxies. The configuration of the API Product Quota fields will populate variables that are accessible in your proxy, and these variables can be fed into a quota policy.

For example, if I have a VerifyAPIKey policy named VerifyKey, I’ll have the following variables populated upon verification of a key with the Quota fields set as 10 requests per 1 second:

```auto
verifyapikey.VerifyKey.apiproduct.developer.quota.limit = 10

verifyapikey.VerifyKey.apiproduct.developer.quota.interval = 1

verifyapikey.VerifyKey.apiproduct.developer.quota.timeunit = second

```

I can then set the Quota policy like this (if the field is not set, I’m allowing a default of 2 calls per minute):

```auto
<Quota async="false" continueOnError="false" enabled="true" name="MyQuota" type="calendar">
    <Allow count="2" countRef="verifyapikey.VerifyKey.apiproduct.developer.quota.limit"/>
    <Interval ref="verifyapikey.VerifyKey.apiproduct.developer.quota.interval">1</Interval>
    <TimeUnit ref="verifyapikey.VerifyKey.apiproduct.developer.quota.timeunit">minute</TimeUnit>
    <Identifier ref='verifyapikey.VerifyKey.client_id'/>
    <Distributed>true</Distributed>
    <Synchronous>false</Synchronous>
    <StartTime>2015-02-13 12:00:00</StartTime>
</Quota>

```

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [April 14, 2015, 2:36pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/3 "2015-04-14T14:36:47Z")

</div>

That’s very helpful, thanks! But what does the verifyapikey.VerifyKey.client\_id variable refer to?

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [April 14, 2015, 2:50pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/4 "2015-04-14T14:50:18Z")

</div>

verifyapikey.VerifyKey.client\_id this variable is populated after the execution of apikey validation policy. This contains the current apikey with which the call came in. This configuration ensures the quota is applied at each unique apikey level.

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [June 13, 2016, 11:04pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/5 "2016-06-13T23:04:57Z")

</div>

Hi,

I have used the same way to apply quota policy to the proxy for various products accessing it via developer apps with different quota intervals for monthly usage. Is there any management api call available to get the current monthly usage of each product/developer app on that proxy?

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [November 10, 2017, 7:12pm UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/6 "2017-11-10T19:12:54Z")

</div>

[@Mike Dunker](https://community.apigee.com/users/89/mdunkerapigeecom.html)

Hi,

If I have more than one API proxy in a product, Is counter distributed to both APIs (or) each API proxy will have it’s own counter to determine quota voilation error?

for ex: quota limit defined on API product is 10 requests every 1 minute. API product has two API proxies ( API1, API2).

If API1 got 3 requests and API2 got 7 requests in one minute duration.

then 4th call to API1 will fail with rate limit error? (or) would API1 accept 10 requests & API2 accepts 10 requests?

---

<div class="post-metadata">

**Author:** ![anonymous8](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@anonymous8](https://discuss.google.dev/u/anonymous8)\
**Post date:** [February 14, 2018, 11:01am UTC](https://discuss.google.dev/t/how-do-the-quota-settings-on-an-api-product-interact-with-quota-policies-in-an-api-proxy/6852/7 "2018-02-14T11:01:38Z")

</div>

[@soujanyaedunuri](https://community.apigee.com/users/10079/soujanyaedunuri.html)

Answer for your question is you should have different quota settings for each API.Quota is not distributed among the API’s which are under one product.

```auto
Please find the more information in this link.
[https://docs.apigee.com/api-services/reference/quota-policy](https://docs.apigee.com/api-services/reference/quota-policy)

```
