alpaca-broker-rate-limits-resilience
Installation
SKILL.md
Alpaca — Rate Limits & Resilience
Alpaca's APIs are rate-limited and occasionally flaky under load. Any client that does more than a handful of calls — especially bulk jobs, backfills, and reconciliation sweeps — needs disciplined retry, backoff, and concurrency control. These patterns are transport-level and apply in any language.
Read
alpaca-broker-integrationfirst.
1. Rate-limit headers — read them on every response
Alpaca returns standard headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit |
requests allowed in the window |
X-RateLimit-Remaining |
requests left in the current window |
X-RateLimit-Reset |
unix timestamp (seconds) when the window resets |
Parse them on every response, not just on errors. Two uses:
- Proactive: when
Remainingdrops below a threshold (e.g. ≤ 50), log a warning and/or slow down — you're about to get throttled. - Reactive: on
429, useResetto wait exactly until the window opens.