Share via

How can I get the remaining quota in APIM when quota-by-key policy in used?

See, Yi Xuan 5 Reputation points
2025-04-07T10:34:30.17+00:00

I am using Azure APIM for the quota-by-key control. However I couldn't get the remaining quotas return so that the user aware and control the usage in a better way.
User's image

I planned to have the remaining quotas return as a header in the outbound section.
I noticed that there is a key remaining-calls-header-name for rate-limit-by-key however it doesn't works for quota-by-key.
Please help me on that.

Azure API Management
Azure API Management

An Azure service that provides a hybrid, multi-cloud management platform for APIs.


1 answer

Sort by: Most helpful
  1. Ranashekar Guda 2,905 Reputation points Moderator
    2025-04-08T18:35:49.64+00:00

    Hello @See, Yi Xuan,

    As mentioned above APIM doesn't allow you to directly add remaining quota in the response header via the quota-by-key policy, you can use the Quota REST API to retrieve this information and incorporate it into your API’s response by calling the API from your backend systems or custom policies. This provides an effective workaround for tracking quota usage and returning it to users.
    Also, for your better understanding,

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.