Rate Limiting - auto disable rule after a certain number of blocked requests

Can I set a limit on a certain number of requests that will take more than a certain cost ?

For example, if you had a total of 35,000 good/allowed requests matching any rate-limiting rule:

  • 1 - 10,000 are free.
  • 10,001 - 20,000 cost $0.05
  • 20,001 - 30,000 cost $0.05
  • 30,001 - 35,000 cost $0.05 (billing is not prorated if you only use a portion of the 10,000 requests paid for)

So I need the block rule to stop working, after reaching 20,000 paid requests, so that I would pay only for 10,001 - 20,000 cost $0.05 and not pay for next 20,001 - 30,000 requests.

Not directly, you can add billable usage notifications so you get a message when you exceed an amount but you can’t take any action based on this. You could look at using the API.

1 Like

This is the right answer, however, it is important to note that billing notifications might be delayed for rather long periods of time.

@Yliss if you are concerned about rate limiting usage, your best bet is either monitoring it yourself or… giving up on it, you could use rate limit on your backend.
Normally it wouldn’t matter too much since it takes a lot of requests for rate limit billing to pile up to a significant amount of money, however, if you are worried from using more than 20k requests I’d definitely look into an alternative.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.