2 keys pulling from same monthly quota?

Is it possible to make 2 separate API keys pull from the same monthly quota?


We'd like to define a monthly quota of say 5,000 calls and let key A & key B pull from that quota. The difference between key A & key B would be, that key A can make say 1 call per minute and key B can make 5 calls per minute.

Thanks,

Hannes

1 1 81
1 REPLY 1

@johannes1 ,

Great Question, Here is what i think about same,

  • When you say 2 API Keys, I believe it's two different apps with keys.
  • Since you would like to associate quota with specific keys , I would suggest to leverage app attributes.
  • For example API Key A associated with App 1, API Key B associated with App 2
  • App 1 will have app attribute quotaPerMinute set to 1, App 2 will have attribute quotaPerMinute set to 5
  • App 1 & 2 will have an attribute called monthlyQuotaIdentifier with same values set to some unique value that identifies App 1 & 2. Let's say App1App2.
  • You will have QuotaPolicy1 with minute interval that pulls the app attribute & applies same based on apikey identifier.
  • You will have QuotaPolicy2 with month interval after above quota policy where identifier is value of montlhyQuotaIdentifier attribute that will be common for both the apps so that key A & key B pull from the same quota based on common identifier.

Hope it helps. Keep us posted if any.