alpaca-broker-rate-limits-resilience

Implements retry, backoff, and concurrency patterns for resilient Alpaca API clients.

4|Updated Aug 28, 2026
One-click install
npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-rate-limits-resilience-alan-d-smith
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: alpaca-broker-rate-limits-resilience
Source: https://github.com/alan-d-smith/synthetix-alpha/tree/main/.agents/skills/alpaca-broker-rate-limits-resilience
Command: npx skills add https://github.com/alan-d-smith/synthetix-alpha --skill alpaca-broker-rate-limits-resilience-alan-d-smith

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Alpaca API clients that run bulk jobs, backfills, or reconciliation sweeps hit rate limits and transient failures; this Skill provides the transport-level patterns to handle HTTP 429 responses, rate-limit headers, and flaky connections without losing data or stalling workers. ## Core Features & Use Cases - Rate-limit header handling: Parse X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on every response to warn proactively and wait precisely until the window resets on a 429. - Retry and backoff loops: Exponential backoff with optional jitter for 5xx and network errors, while surfacing non-retryable 4xx errors instead of retrying them. - Bounded concurrency and pagination: Fixed worker pools, per-run caching, token-based pagination loops for activities and market-data bars, timeouts, and chunked bulk writes. - Use Case: You are building a nightly reconciliation cron job against the Alpaca Broker API. Use this Skill to structure the job so it pages through all account activities, backs off correctly on 429s, and writes results idempotently in chunks. ## Quick Start Use the alpaca rate limits skill to design a retry and pagination wrapper for my Alpaca bulk data backfill job.

Frequently Asked Questions about alpaca-broker-rate-limits-resilience

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Alpaca API rate limits and HTTP 429 errors?▼

On a 429 response, read the X-RateLimit-Reset header and wait until that unix timestamp plus a roughly one-second buffer instead of blindly backing off. Parse X-RateLimit-Remaining on every response to slow down proactively before hitting the limit.

How to retry failed Alpaca API requests with exponential backoff?▼

Retry network errors and 5xx statuses with exponential backoff of base delay times 2^(attempt-1), optionally with jitter, capped at a fixed number of attempts. Do not retry non-retryable 4xx errors like 400, 403, or 422 since they will not fix themselves.

How does pagination work for Alpaca activities and market data endpoints?▼

Activities endpoints page via the X-Next-Page-Token response header, while market-data bars return next_page_token in the body to pass back as page_token. Loop until the token is empty, since a single page may contain only the first symbols.

What concurrency level is safe for bulk Alpaca API jobs?▼

Use a fixed worker pool of roughly 5 to 8 concurrent requests rather than unbounded fan-out, and tune against the rate-limit headers. Cache repeated per-entity reads within a run and consider a small fixed sleep between calls as a throttling floor.

Why does my Alpaca bulk job hang or stall during execution?▼

Jobs stall when HTTP requests lack timeouts, so always set a 15 to 30 second timeout per call and use a shared connection pool. SSE streams are the exception since they are designed to stay open.