Quota and Failure 40x, avoid decrement

Hello @Michal_Gorski and welcome to the community :partying_face:

I don’t think this is possible via Tyk out of the box. Rate limit and quota updates occur on the request after authentication, but before it is proxied upstream. As such the quota is considered/deducted before a response is received.

You could achieve your goal with the help of custom plugins especially with golang or python. The crux involves making a seperate connection to redis and then modifying the key with quota- prefix. You can find more info about quotas here . The gist of it all is

key.quota_remaining = key.quota_max - quota