You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to explore whether FastAPI could provide built-in rate limiting support, with a simple API like the example above. The goal would be to limit requests per client and return HTTP 429 when the limit is exceeded. I would like to get feedback from the maintainers on whether this belongs in FastAPI and, if so, what API/design would be appropriate before implementing it.
Operating System
Linux, Windows, macOS
Operating System Details
No response
FastAPI Version
0.141.1
Pydantic Version
2.13.4
Python Version
Python 3.13.13
Additional Context
Hi FastAPI community,
I’m interested in contributing to FastAPI and I have an idea for adding rate-limiting support.
Would a built-in rate limiter be something that FastAPI would consider accepting?
Is rate limiting a feature that belongs in FastAPI?
Would you prefer this to be a separate package?
If it is suitable for FastAPI, is there a recommended design or approach I should follow?
I’d be happy to implement it and add tests if the idea is considered appropriate.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
First Check
Commit to Help
Example Code
Description
I would like to explore whether FastAPI could provide built-in rate limiting support, with a simple API like the example above. The goal would be to limit requests per client and return HTTP 429 when the limit is exceeded. I would like to get feedback from the maintainers on whether this belongs in FastAPI and, if so, what API/design would be appropriate before implementing it.
Operating System
Linux, Windows, macOS
Operating System Details
No response
FastAPI Version
0.141.1
Pydantic Version
2.13.4
Python Version
Python 3.13.13
Additional Context
Hi FastAPI community,
I’m interested in contributing to FastAPI and I have an idea for adding rate-limiting support.
Would a built-in rate limiter be something that FastAPI would consider accepting?
For example:
@app.get("/items", dependencies=[RateLimiter(limit=100, window=60)])
async def get_items():
return {"items": []}
Before I start working on it, I wanted to ask:
Is rate limiting a feature that belongs in FastAPI?
Would you prefer this to be a separate package?
If it is suitable for FastAPI, is there a recommended design or approach I should follow?
I’d be happy to implement it and add tests if the idea is considered appropriate.
Thanks!
All reactions