Creator · alpacahq
Last updated · Sep 1, 2026
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in a
Creator · alpacahq
Last updated · Sep 1, 2026
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in a
Creator · alpacahq
Last updated · Sep 1, 2026
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in a
Creator · alpacahq
Last updated · Sep 1, 2026
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in a
Sandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-rate-limits-resilience" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/rate-limits-resilience. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-rate-limits-resilience","task":"Install alpaca-broker-rate-limits-resilience","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Maintenance
fresh
11d since push
Risk
Needs review
Permission surface may require sandboxing
GitHub quality
112
67/100 Quality · 76/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
112 GitHub stars
Repo activity
112 stars, 11 forks
Maintenance
11d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Agent should check
Copy prompt
Task: Use alpaca-broker-rate-limits-resilience in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
LLM text format
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-rate-limits-resilience&limit=3
Agent prompt
Use alpaca-broker-rate-limits-resilience for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-rate-limits-resilience
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-rate-limits-resilience%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Testing and QA
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO112 GitHub stars
Stars/forks activity
CHECK112 stars, 11 forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-rate-limits-resilience description: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. ---
# 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-integration` first.
## 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 `Remaining` drops below a threshold (e.g. ≤ 50), log a warning and/or slow down — you're about to get throttled. - **Reactive:** on `429`, use `Reset` to wait exactly until the window opens.
> Limits vary by endpoint and plan; market-data limits differ from broker limits. Don't hardcode a number — react to the headers.
## 2. The retry loop (pseudocode)
``` MAX_ATTEMPTS = 10 INITIAL_DELAY_MS = 1000
for attempt in 1..MAX_ATTEMPTS: res = http(request) # with a sane timeout (see §5) remaining, reset_at = parse_rate_headers(res.headers) if remaining <= 50: log_warn("approaching rate limit", reset_at)
if res.status == 429: # wait until the window resets, plus a small buffer wait = (reset_at - now()) if reset_at else INITIAL_DELAY_MS * 2^(attempt-1) sleep(max(0, wait) + 1000) # +1s buffer past reset continue
if res.status in (500, 502, 503, 504) or network_error: sleep(INITIAL_DELAY_MS * 2^(attempt-1)) # exponential backoff continue
return res # success or non-retryable 4xx raise last_error ```
Key points: - **On `429`, wait until `X-RateLimit-Reset` + a ~1s buffer** — don't blindly exponential-backoff when the API told you exactly when to retry. - **Exponential backoff** (`base * 2^(attempt-1)`) for network errors and 5xx. With base 1s and 10 attempts the tail is minutes — fine for background jobs, too slow for user-facing calls (use fewer attempts there). - **Don't retry non-retryable 4xx** (`400`/`403`/`422`) — those won't fix themselves; surface them. - Optionally add **jitter** to backoff to avoid thundering-herd when many workers retry together.
## 3. Bounded concurrency
Parallelism speeds bulk jobs but is the fastest way to hit limits. Use a **fixed worker pool**, not unbounded fan-out.
- Start small (e.g. **5–8 concurrent requests**) and tune against the rate-limit headers. A real lesson from production: a pool was *reduced* from 10 → 5 to ease both Alpaca and downstream-DB load. - Cache per-entity reads **within a run** (e.g. an account's buying power, or a per-account transfer list) so you don't refetch the same thing across items in a batch. - For per-item throttling, a small fixed sleep between calls (e.g. 100ms) is a crude-but-effective floor when you can't easily coordinate a pool.
## 4. Pagination loops
List endpoints page forward with a token — never assume one response is complete.
- **Activities** (`/v1/accounts/activities`): page via the `X-Next-Page-Token` response header; loop until it's empty. Use `page_size` (≤100) and a `direction`. - **Market-data bars** (`/v2/stocks/bars`): page via `next_page_token` in the body → pass back as `page_token`. Remember `limit` counts across all symbols and results sort by symbol-then-time, so **a single page may contain only the first symbol(s)** — keep paging. - Wrap each page fetch in the retry loop from §2.
``` token = null loop: page = fetch(url + (token ? "&page_token="+token : "")) # via retry loop accumulate(page.items) token = page.next_token # header or body, per endpoint if not token: break ```
## 5. Timeouts & batch sizing
- **Always set an HTTP timeout** (e.g. 15–30s). A hung connection without a timeout stalls a whole worker pool. (SSE streams are the exception — they're meant to stay open; see `alpaca-broker-sse-events`.) - Use a **shared HTTP client / connection pool** rather than constructing one per request, so keep-alive and connection reuse work. - When writing reconciliation results to your own store, **chunk bulk inserts** (e.g. 500 rows per statement) to stay under DB statement-size limits and keep transactions reasonable.
## 6. Resilience checklist for a bulk/cron job
- [ ] Rate-limit headers parsed every response; proactive warn near the limit. - [ ] `429` → wait until `X-RateLimit-Reset` + buffer. - [ ] Exponential backoff (+ jitter) for 5xx/network; capped attempts. - [ ] Non-retryable 4xx surfaced, not retried. - [ ] Bounded worker pool; per-run caching of repeated reads. - [ ] Pagination loop until the token is empty. - [ ] HTTP timeout on every call; shared client. - [ ] Bulk DB writes chunked and idempotent (upsert) — see `alpaca-broker-reconciliation-idempotency`. - [ ] Structured logging with a trace/correlation ID per item for debugging partial failures.
**Related skills:** safe re-runs of jobs → `alpaca-broker-reconciliation-idempotency`; the heal/poll jobs that use these patterns → `alpaca-broker-reconciliation-idempotency`; market-data pagination specifics → `alpaca-broker-market-data`.
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-rate-limits-resilience, ready for a manual X post.
alpaca-broker-rate-limits-resilience: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential... 112 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x
Listing + install path for alpaca-broker-rate-limits-resilience: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-rate-limits-resilience" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/rate-limits-resilience. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-rate-limits-resilience","task":"Install alpaca-broker-rate-limits-resilience","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Maintenance
fresh
11d since push
Risk
Needs review
Permission surface may require sandboxing
GitHub quality
112
67/100 Quality · 76/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
112 GitHub stars
Repo activity
112 stars, 11 forks
Maintenance
11d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Agent should check
Copy prompt
Task: Use alpaca-broker-rate-limits-resilience in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
LLM text format
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-rate-limits-resilience&limit=3
Agent prompt
Use alpaca-broker-rate-limits-resilience for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-rate-limits-resilience
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-rate-limits-resilience%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Testing and QA
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO112 GitHub stars
Stars/forks activity
CHECK112 stars, 11 forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-rate-limits-resilience description: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. ---
# 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-integration` first.
## 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 `Remaining` drops below a threshold (e.g. ≤ 50), log a warning and/or slow down — you're about to get throttled. - **Reactive:** on `429`, use `Reset` to wait exactly until the window opens.
> Limits vary by endpoint and plan; market-data limits differ from broker limits. Don't hardcode a number — react to the headers.
## 2. The retry loop (pseudocode)
``` MAX_ATTEMPTS = 10 INITIAL_DELAY_MS = 1000
for attempt in 1..MAX_ATTEMPTS: res = http(request) # with a sane timeout (see §5) remaining, reset_at = parse_rate_headers(res.headers) if remaining <= 50: log_warn("approaching rate limit", reset_at)
if res.status == 429: # wait until the window resets, plus a small buffer wait = (reset_at - now()) if reset_at else INITIAL_DELAY_MS * 2^(attempt-1) sleep(max(0, wait) + 1000) # +1s buffer past reset continue
if res.status in (500, 502, 503, 504) or network_error: sleep(INITIAL_DELAY_MS * 2^(attempt-1)) # exponential backoff continue
return res # success or non-retryable 4xx raise last_error ```
Key points: - **On `429`, wait until `X-RateLimit-Reset` + a ~1s buffer** — don't blindly exponential-backoff when the API told you exactly when to retry. - **Exponential backoff** (`base * 2^(attempt-1)`) for network errors and 5xx. With base 1s and 10 attempts the tail is minutes — fine for background jobs, too slow for user-facing calls (use fewer attempts there). - **Don't retry non-retryable 4xx** (`400`/`403`/`422`) — those won't fix themselves; surface them. - Optionally add **jitter** to backoff to avoid thundering-herd when many workers retry together.
## 3. Bounded concurrency
Parallelism speeds bulk jobs but is the fastest way to hit limits. Use a **fixed worker pool**, not unbounded fan-out.
- Start small (e.g. **5–8 concurrent requests**) and tune against the rate-limit headers. A real lesson from production: a pool was *reduced* from 10 → 5 to ease both Alpaca and downstream-DB load. - Cache per-entity reads **within a run** (e.g. an account's buying power, or a per-account transfer list) so you don't refetch the same thing across items in a batch. - For per-item throttling, a small fixed sleep between calls (e.g. 100ms) is a crude-but-effective floor when you can't easily coordinate a pool.
## 4. Pagination loops
List endpoints page forward with a token — never assume one response is complete.
- **Activities** (`/v1/accounts/activities`): page via the `X-Next-Page-Token` response header; loop until it's empty. Use `page_size` (≤100) and a `direction`. - **Market-data bars** (`/v2/stocks/bars`): page via `next_page_token` in the body → pass back as `page_token`. Remember `limit` counts across all symbols and results sort by symbol-then-time, so **a single page may contain only the first symbol(s)** — keep paging. - Wrap each page fetch in the retry loop from §2.
``` token = null loop: page = fetch(url + (token ? "&page_token="+token : "")) # via retry loop accumulate(page.items) token = page.next_token # header or body, per endpoint if not token: break ```
## 5. Timeouts & batch sizing
- **Always set an HTTP timeout** (e.g. 15–30s). A hung connection without a timeout stalls a whole worker pool. (SSE streams are the exception — they're meant to stay open; see `alpaca-broker-sse-events`.) - Use a **shared HTTP client / connection pool** rather than constructing one per request, so keep-alive and connection reuse work. - When writing reconciliation results to your own store, **chunk bulk inserts** (e.g. 500 rows per statement) to stay under DB statement-size limits and keep transactions reasonable.
## 6. Resilience checklist for a bulk/cron job
- [ ] Rate-limit headers parsed every response; proactive warn near the limit. - [ ] `429` → wait until `X-RateLimit-Reset` + buffer. - [ ] Exponential backoff (+ jitter) for 5xx/network; capped attempts. - [ ] Non-retryable 4xx surfaced, not retried. - [ ] Bounded worker pool; per-run caching of repeated reads. - [ ] Pagination loop until the token is empty. - [ ] HTTP timeout on every call; shared client. - [ ] Bulk DB writes chunked and idempotent (upsert) — see `alpaca-broker-reconciliation-idempotency`. - [ ] Structured logging with a trace/correlation ID per item for debugging partial failures.
**Related skills:** safe re-runs of jobs → `alpaca-broker-reconciliation-idempotency`; the heal/poll jobs that use these patterns → `alpaca-broker-reconciliation-idempotency`; market-data pagination specifics → `alpaca-broker-market-data`.
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-rate-limits-resilience, ready for a manual X post.
alpaca-broker-rate-limits-resilience: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential... 112 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x
Listing + install path for alpaca-broker-rate-limits-resilience: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-rate-limits-resilience" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/rate-limits-resilience. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-rate-limits-resilience","task":"Install alpaca-broker-rate-limits-resilience","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Maintenance
fresh
11d since push
Risk
Needs review
Permission surface may require sandboxing
GitHub quality
112
67/100 Quality · 76/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
112 GitHub stars
Repo activity
112 stars, 11 forks
Maintenance
11d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Agent should check
Copy prompt
Task: Use alpaca-broker-rate-limits-resilience in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
LLM text format
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-rate-limits-resilience&limit=3
Agent prompt
Use alpaca-broker-rate-limits-resilience for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-rate-limits-resilience
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-rate-limits-resilience%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Testing and QA
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO112 GitHub stars
Stars/forks activity
CHECK112 stars, 11 forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-rate-limits-resilience description: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. ---
# 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-integration` first.
## 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 `Remaining` drops below a threshold (e.g. ≤ 50), log a warning and/or slow down — you're about to get throttled. - **Reactive:** on `429`, use `Reset` to wait exactly until the window opens.
> Limits vary by endpoint and plan; market-data limits differ from broker limits. Don't hardcode a number — react to the headers.
## 2. The retry loop (pseudocode)
``` MAX_ATTEMPTS = 10 INITIAL_DELAY_MS = 1000
for attempt in 1..MAX_ATTEMPTS: res = http(request) # with a sane timeout (see §5) remaining, reset_at = parse_rate_headers(res.headers) if remaining <= 50: log_warn("approaching rate limit", reset_at)
if res.status == 429: # wait until the window resets, plus a small buffer wait = (reset_at - now()) if reset_at else INITIAL_DELAY_MS * 2^(attempt-1) sleep(max(0, wait) + 1000) # +1s buffer past reset continue
if res.status in (500, 502, 503, 504) or network_error: sleep(INITIAL_DELAY_MS * 2^(attempt-1)) # exponential backoff continue
return res # success or non-retryable 4xx raise last_error ```
Key points: - **On `429`, wait until `X-RateLimit-Reset` + a ~1s buffer** — don't blindly exponential-backoff when the API told you exactly when to retry. - **Exponential backoff** (`base * 2^(attempt-1)`) for network errors and 5xx. With base 1s and 10 attempts the tail is minutes — fine for background jobs, too slow for user-facing calls (use fewer attempts there). - **Don't retry non-retryable 4xx** (`400`/`403`/`422`) — those won't fix themselves; surface them. - Optionally add **jitter** to backoff to avoid thundering-herd when many workers retry together.
## 3. Bounded concurrency
Parallelism speeds bulk jobs but is the fastest way to hit limits. Use a **fixed worker pool**, not unbounded fan-out.
- Start small (e.g. **5–8 concurrent requests**) and tune against the rate-limit headers. A real lesson from production: a pool was *reduced* from 10 → 5 to ease both Alpaca and downstream-DB load. - Cache per-entity reads **within a run** (e.g. an account's buying power, or a per-account transfer list) so you don't refetch the same thing across items in a batch. - For per-item throttling, a small fixed sleep between calls (e.g. 100ms) is a crude-but-effective floor when you can't easily coordinate a pool.
## 4. Pagination loops
List endpoints page forward with a token — never assume one response is complete.
- **Activities** (`/v1/accounts/activities`): page via the `X-Next-Page-Token` response header; loop until it's empty. Use `page_size` (≤100) and a `direction`. - **Market-data bars** (`/v2/stocks/bars`): page via `next_page_token` in the body → pass back as `page_token`. Remember `limit` counts across all symbols and results sort by symbol-then-time, so **a single page may contain only the first symbol(s)** — keep paging. - Wrap each page fetch in the retry loop from §2.
``` token = null loop: page = fetch(url + (token ? "&page_token="+token : "")) # via retry loop accumulate(page.items) token = page.next_token # header or body, per endpoint if not token: break ```
## 5. Timeouts & batch sizing
- **Always set an HTTP timeout** (e.g. 15–30s). A hung connection without a timeout stalls a whole worker pool. (SSE streams are the exception — they're meant to stay open; see `alpaca-broker-sse-events`.) - Use a **shared HTTP client / connection pool** rather than constructing one per request, so keep-alive and connection reuse work. - When writing reconciliation results to your own store, **chunk bulk inserts** (e.g. 500 rows per statement) to stay under DB statement-size limits and keep transactions reasonable.
## 6. Resilience checklist for a bulk/cron job
- [ ] Rate-limit headers parsed every response; proactive warn near the limit. - [ ] `429` → wait until `X-RateLimit-Reset` + buffer. - [ ] Exponential backoff (+ jitter) for 5xx/network; capped attempts. - [ ] Non-retryable 4xx surfaced, not retried. - [ ] Bounded worker pool; per-run caching of repeated reads. - [ ] Pagination loop until the token is empty. - [ ] HTTP timeout on every call; shared client. - [ ] Bulk DB writes chunked and idempotent (upsert) — see `alpaca-broker-reconciliation-idempotency`. - [ ] Structured logging with a trace/correlation ID per item for debugging partial failures.
**Related skills:** safe re-runs of jobs → `alpaca-broker-reconciliation-idempotency`; the heal/poll jobs that use these patterns → `alpaca-broker-reconciliation-idempotency`; market-data pagination specifics → `alpaca-broker-market-data`.
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-rate-limits-resilience, ready for a manual X post.
alpaca-broker-rate-limits-resilience: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential... 112 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x
Listing + install path for alpaca-broker-rate-limits-resilience: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsSandbox only
Install targets
Codex install prompt
Install the "alpaca-broker-rate-limits-resilience" agent skill from https://github.com/alpacahq/alpaca-skills/tree/main/skills/broker-api/rate-limits-resilience. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"alpacahq-alpaca-broker-rate-limits-resilience","task":"Install alpaca-broker-rate-limits-resilience","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Maintenance
fresh
11d since push
Risk
Needs review
Permission surface may require sandboxing
GitHub quality
112
67/100 Quality · 76/100 Trust
Coverage tags
Review notes
Permission surface may require sandboxing · Financial research output is not financial advice; require human review before any live investment decision
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
112 GitHub stars
Repo activity
112 stars, 11 forks
Maintenance
11d since push
License
Apache-2.0
Install
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceDo not use when
Alternative
174.2K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
84.4K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
174.2K Stars
npx skills add anthropics/skills --skill canvas-design
Alternative
174.2K Stars
npx skills add anthropics/skills --skill brand-guidelines
Agent safety v2
Sparse or mixed signals. Useful for discovery, but not for autonomous installation.
Test manually in an isolated workspace and compare against safer alternatives.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Agent should check
Copy prompt
Task: Use alpaca-broker-rate-limits-resilience in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20alpaca-broker-rate-limits-resilience%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
Install command: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install
LLM text format
/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install?format=text
Find alternatives
/api/skills/search?q=alpaca-broker-rate-limits-resilience&limit=3
Agent prompt
Use alpaca-broker-rate-limits-resilience for this task. Review https://www.openagentskill.com/api/skills/alpacahq-alpaca-broker-rate-limits-resilience/install, then install with: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilienceRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience
LLM text
/api/registry/manifest/alpacahq-alpaca-broker-rate-limits-resilience?format=text
Install alias
/api/registry/install/alpacahq-alpaca-broker-rate-limits-resilience
Recommend
/api/registry/recommend?task=Use%20alpaca-broker-rate-limits-resilience%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Testing and QA
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO112 GitHub stars
Stars/forks activity
CHECK112 stars, 11 forks; issue activity unavailable in current metadata
Recent maintenance
PASS11d since push
License clarity
PASSApache-2.0
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
--- name: alpaca-broker-rate-limits-resilience description: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker pools, pagination loops, batch sizing, and timeouts. Use when building robust REST clients, bulk/cron jobs, or reconciliation sweeps against Alpaca in any language. ---
# 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-integration` first.
## 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 `Remaining` drops below a threshold (e.g. ≤ 50), log a warning and/or slow down — you're about to get throttled. - **Reactive:** on `429`, use `Reset` to wait exactly until the window opens.
> Limits vary by endpoint and plan; market-data limits differ from broker limits. Don't hardcode a number — react to the headers.
## 2. The retry loop (pseudocode)
``` MAX_ATTEMPTS = 10 INITIAL_DELAY_MS = 1000
for attempt in 1..MAX_ATTEMPTS: res = http(request) # with a sane timeout (see §5) remaining, reset_at = parse_rate_headers(res.headers) if remaining <= 50: log_warn("approaching rate limit", reset_at)
if res.status == 429: # wait until the window resets, plus a small buffer wait = (reset_at - now()) if reset_at else INITIAL_DELAY_MS * 2^(attempt-1) sleep(max(0, wait) + 1000) # +1s buffer past reset continue
if res.status in (500, 502, 503, 504) or network_error: sleep(INITIAL_DELAY_MS * 2^(attempt-1)) # exponential backoff continue
return res # success or non-retryable 4xx raise last_error ```
Key points: - **On `429`, wait until `X-RateLimit-Reset` + a ~1s buffer** — don't blindly exponential-backoff when the API told you exactly when to retry. - **Exponential backoff** (`base * 2^(attempt-1)`) for network errors and 5xx. With base 1s and 10 attempts the tail is minutes — fine for background jobs, too slow for user-facing calls (use fewer attempts there). - **Don't retry non-retryable 4xx** (`400`/`403`/`422`) — those won't fix themselves; surface them. - Optionally add **jitter** to backoff to avoid thundering-herd when many workers retry together.
## 3. Bounded concurrency
Parallelism speeds bulk jobs but is the fastest way to hit limits. Use a **fixed worker pool**, not unbounded fan-out.
- Start small (e.g. **5–8 concurrent requests**) and tune against the rate-limit headers. A real lesson from production: a pool was *reduced* from 10 → 5 to ease both Alpaca and downstream-DB load. - Cache per-entity reads **within a run** (e.g. an account's buying power, or a per-account transfer list) so you don't refetch the same thing across items in a batch. - For per-item throttling, a small fixed sleep between calls (e.g. 100ms) is a crude-but-effective floor when you can't easily coordinate a pool.
## 4. Pagination loops
List endpoints page forward with a token — never assume one response is complete.
- **Activities** (`/v1/accounts/activities`): page via the `X-Next-Page-Token` response header; loop until it's empty. Use `page_size` (≤100) and a `direction`. - **Market-data bars** (`/v2/stocks/bars`): page via `next_page_token` in the body → pass back as `page_token`. Remember `limit` counts across all symbols and results sort by symbol-then-time, so **a single page may contain only the first symbol(s)** — keep paging. - Wrap each page fetch in the retry loop from §2.
``` token = null loop: page = fetch(url + (token ? "&page_token="+token : "")) # via retry loop accumulate(page.items) token = page.next_token # header or body, per endpoint if not token: break ```
## 5. Timeouts & batch sizing
- **Always set an HTTP timeout** (e.g. 15–30s). A hung connection without a timeout stalls a whole worker pool. (SSE streams are the exception — they're meant to stay open; see `alpaca-broker-sse-events`.) - Use a **shared HTTP client / connection pool** rather than constructing one per request, so keep-alive and connection reuse work. - When writing reconciliation results to your own store, **chunk bulk inserts** (e.g. 500 rows per statement) to stay under DB statement-size limits and keep transactions reasonable.
## 6. Resilience checklist for a bulk/cron job
- [ ] Rate-limit headers parsed every response; proactive warn near the limit. - [ ] `429` → wait until `X-RateLimit-Reset` + buffer. - [ ] Exponential backoff (+ jitter) for 5xx/network; capped attempts. - [ ] Non-retryable 4xx surfaced, not retried. - [ ] Bounded worker pool; per-run caching of repeated reads. - [ ] Pagination loop until the token is empty. - [ ] HTTP timeout on every call; shared client. - [ ] Bulk DB writes chunked and idempotent (upsert) — see `alpaca-broker-reconciliation-idempotency`. - [ ] Structured logging with a trace/correlation ID per item for debugging partial failures.
**Related skills:** safe re-runs of jobs → `alpaca-broker-reconciliation-idempotency`; the heal/poll jobs that use these patterns → `alpaca-broker-reconciliation-idempotency`; market-data pagination specifics → `alpaca-broker-market-data`.
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for alpaca-broker-rate-limits-resilience, ready for a manual X post.
alpaca-broker-rate-limits-resilience: Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential... 112 stars https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x
Listing + install path for alpaca-broker-rate-limits-resilience: https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=x Install: npx skills add alpacahq/alpaca-skills --skill alpaca-broker-rate-limits-resilience
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to alpacahq but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience/audit)
[](https://www.openagentskill.com/skills/alpacahq-alpaca-broker-rate-limits-resilience?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)alpacahq
@alpacahq
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
174.2K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
84.4K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
174.2K StarsAnthropic Brand Guidelines
Apply Anthropic official brand colors, typography, and visual standards to appropriate Anthropic-related artifacts.
174.2K StarsPermission surface
secrets or environment access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness
Permission surface
secrets or environment access, network or browser access
Agent outcomes
No agent outcome data yet
Docs
Usable metadata, review docs
Risk summary
Install readiness