#615·chalice

[proposal] Add support for throttling per route

Author: jameslsCreated Nov 17, 2017Updated Jan 3, 2026
Labelsproposals

API Gateway has various forms of API throttling. This proposal adds support for throttling at the routing level. This allows you to specify a rate and burst limit per @app.route.

Similar to CORS and authorizers, there will be a new param, throttle, that takes an instance of ThrottleConfig:

python

@app.route('/', throttle=ThrottleConfig(rate=10, burst=15))
def index(): pass

ThrottleConfig accepts two arguments, rate and burst:

python
class ThrottleConfig(object):
    def __init__(self, rate: int, burst: int): pass

The rate and burst params map to the corresponding concepts described in the API Gateway throttling docs