fastapi-rate-limiting

Installation
SKILL.md

FastAPI 限流(SlowAPI)

来源:https://github.com/laurentS/slowapi

用途

基于 limits 的 FastAPI/Starlette 限流库,从 flask-limiter 移植。支持路由级装饰器限流、全局默认限流、多后端存储,超限返回 HTTP 429。

何时使用

  • 按 IP / 用户 / 自定义 key 限制请求频率
  • 公共 API 防刷、登录防爆破、昂贵端点配额
  • 需要 Redis 做多实例共享限流状态

基础用法

pip install slowapi
Installs
1
First Seen
Jun 19, 2026