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: slow down as
Remainingfalls toward zero, rather than waiting to be throttled. Any warning threshold you pick is your own starting point, derived fromLimit— Alpaca publishes none. - Reactive: on
429, useResetto wait exactly until the window opens.