Rate Limits
Distributed atomic Redis token buckets protect tenant quotas and upstream capacity.
Default Token Bucket Tiers
| Bucket Scope | Refill Rate | Burst Capacity |
|---|---|---|
| Per API Key | 60 / min | 10 |
| Per Organization | 120 / min | 20 |
| Global Platform Upstream | 600 / min | 60 |
Rate-Limit Response Headers
| Header | Type | Description |
|---|---|---|
| X-Request-ID | string | Unique request trace identifier echoed in `meta.request_id` |
| X-RateLimit-Limit | integer | Maximum burst token capacity for the active rate-limit bucket |
| X-RateLimit-Remaining | integer | Remaining tokens available in the tightest tenant rate-limit bucket |
| X-RateLimit-Reset | integer | Unix epoch timestamp (seconds) when the rate-limit bucket reaches full capacity |
| Retry-After | integer | Seconds to wait before retrying |
Fail-Closed Policy
If Redis is temporarily unreachable, the gateway fails closed with HTTP 503 SERVICE_UNAVAILABLE and Retry-After without touching the wallet.