# title
Per-Route Rate Limit Ceilings (rate.limit)

# description
Per-route requests-per-second ceilings the gateway edge enforces (Redis token bucket). Projected by scripts/codegen/forward/trust/ratelimit/compile.py into the runtime constants the gateway rate-limit middleware reads. A route not listed inherits `defaults`. This is the request-rate sibling of the spend perimeter (spend.budget, ADR-088): one declares $/run ceilings, this declares RPS ceilings — both flow DSL -> codegen -> runtime gate.

# properties.defaults.description
Ceiling applied to any route not explicitly listed under `routes`.

# properties.routes.description
Per-route RPS ceilings keyed by a stable route id (mirrors the chi route name / Scope.route axis). `_to_`-free snake/dot identifier.

# $defs.limit.properties.rps.description
Sustained requests-per-second ceiling (token refill rate).

# $defs.limit.properties.burst.description
Bucket depth — the instantaneous burst allowance above `rps`.

# $defs.limit.properties.scope.description
Keying axis for the bucket: authenticated user id, client IP, or one shared bucket.

# $defs.limit.properties.mode.description
`enforce` rejects with 429 over-ceiling; `shadow` only counts (metrics) and never blocks — the staged-rollout posture.

# $defs.limit.properties.match.description
Optional path prefix the gateway middleware matches this ceiling against. Omit for ceilings bound by route id alone.