account-onboarding
Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements,…
Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when a developer wants to build on Alpaca — open brokerage accounts, run KYC, fund accounts, move money via journals, place orders, consume real-time event
$ npx -y skills add alpacahq/alpaca-skills --skill integration --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/integrationContext preview
The summary Claude sees to decide when to auto-load this skill.
Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when a developer wants to build on Alpaca — open brokerage accounts, run KYC, fund accounts, move money via journals, place orders, consume real-time event
name: alpaca-broker-integration description: Entry point for integrating with the Alpaca Broker API (plus Market Data and Trading APIs) in any programming language. Use when a developer wants to build on Alpaca — open brokerage accounts, run KYC, fund accounts, move money via journals, place orders, consume real-time event streams, or pull market data — and need to know base URLs, auth, conventions, or which focused sub-skill to use.
You are an expert on the **Alpaca** APIs. Help developers integrate with Alpaca in **any programming language**. Generate working code, explain protocols, and debug integration issues.
This is the **router / overview** skill. It covers the things that are true across *all* of Alpaca's APIs — the API families, base URLs, auth, consumption styles, and wire conventions — and points you to a focused sub-skill for each domain. Read this first, then jump to the specific skill for the task.
> Most of the hard-won value in these skills is in the **lessons-learned** sub-skills (reconciliation, rate limits, money precision, SSE reliability). Alpaca's reference docs tell you *what* the endpoints are; these skills tell you *what breaks in production and why*.
---
**Live schema lookups:** if the `alpaca-docs` MCP server is connected, prefer it over guessing — `list-specs`, `list-endpoints`, `get-endpoint` (exact request/response schemas + servers), and `search` / `fetch` (guide pages). Always confirm an exact payload against the spec before generating code that posts money or orders.
---
| Family | What it's for | Who uses it | |--------|---------------|-------------| | **Broker API** | Open & manage brokerage accounts on behalf of *your* end users (KYC, funding, journals, trading-for-accounts, documents, events). You are the broker-of-record's tech partner; you custody many sub-accounts under your firm. | Apps that onboard their own users and hold their assets (neobrokers, fintechs). | | **Trading API** | Trade a *single* account that belongs to the API-key holder. | Individual algo traders, bots. | | **Market Data API** | Real-time + historical prices, bars, quotes, trades, news, corporate actions, screener. REST and WebSocket. | Everyone. | | **Authentication API** | Issues access tokens: `client_credentials` for your own machine-to-machine calls, plus OAuth 2.0 flows for letting third parties act on an Alpaca account. | Every Broker partner; OAuth integrations. |
**Decide first which family you're on — it changes the base URL, the auth, and the URL shape of every call.** The most common confusion: Broker API places orders at `/v1/trading/accounts/{account_id}/orders` (the account is in the path because you act *for* a user), whereas the standalone Trading API places orders at `/v2/orders` (implicitly *your own* account).
These skills focus primarily on the **Broker API**, because that's where the lifecycle is hardest: onboarding, funding rails, journals, and event reconciliation.
---
| Family | Production | Sandbox / Paper | |--------|-----------|-----------------| | **Broker API** | `https://broker-api.alpaca.markets` | `https://broker-api.sandbox.alpaca.markets` | | **Trading API** | `https://api.alpaca.markets` | `https://paper-api.alpaca.markets` (paper) | | **Market Data (REST)** | `https://data.alpaca.markets` | `https://data.sandbox.alpaca.markets` | | **Market Data (WebSocket)** | `wss://stream.data.alpaca.markets` | `wss://stream.data.sandbox.alpaca.markets` |
**Always start in sandbox.** Switch by environment variable, never by code path — a single `ENV` flag that selects the base URL is the pattern that survives. Sandbox accounts can be funded with fake money and auto-approved, so you can exercise the full lifecycle without real KYC or cash.
---
POST https://authx.alpaca.markets/v1/oauth2/token
(sandbox: https://authx.sandbox.alpaca.markets/v1/oauth2/token)
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>The secret goes in the **body** (`client_secret_post`), not in an `Authorization` header. The response is `{"access_token": "…", "expires_in": 899, "token_type": "Bearer"}` — tokens are valid **15 minutes**. Send it as `Authorization: Bearer <token>`.
Documented for the Broker API, and for Broker partners calling Market Data over both REST and WebSocket. On the WebSocket the auth message uses the literal key `access_token`:
{"action": "auth", "key": "access_token", "secret": "<ACCESS_TOKEN>"}Not yet available for the Trading API.
**Cache the token per process and refresh before expiry** — around 12 of the 15 minutes. Hold it behind one accessor that can refresh, not a startup constant. Treat a `401` on a long-lived call as *refresh and retry once* before treating it as bad credentials; whether an already-open SSE stream survives token expiry is not documented.
APCA-API-KEY-ID: <API_KEY_ID> APCA-API-SECRET-KEY: <API_SECRET_KEY>
Broker also accepts `Authorization: Basic base64("<API_KEY_ID>:<API_SECRET_KEY>")` on REST and SSE. The Trading API uses the `APCA-API-*` headers only. For the WebSocket data stream you don't use headers — you send an auth message *after* connecting:
{"action": "auth", "key": "<API_KEY_ID>", "secret": "<API_SECRET_KEY>"}> Pick one
Open agent skills for Alpaca's Trading API and Broker API. Each skill is a SKILL.md file with step-by-step instructions your AI coding assistant follows when you ask it to complete a task, such as running a historical backtest, onboarding Broker API accounts,
Open and manage brokerage accounts via the Alpaca Broker API — account creation, KYC/CIP, identity & disclosures, agreements,…
Move money between an Alpaca brokerage account and the EXTERNAL banking world via the Broker API — ACH relationships, wire…
Move cash (JNLC) and securities (JNLS) BETWEEN accounts inside your own Alpaca omnibus via the Broker API — single, batch, and…
Pull and stream US stock market data from Alpaca — REST snapshots/bars/trades/quotes, historical bars with timeframes and feeds…
Handle money and numeric precision correctly with the Alpaca API — numbers-as-strings on the wire, decimals vs floats,…
Make Alpaca API clients resilient — rate-limit header handling, HTTP 429 backoff, exponential retry, bounded concurrency/worker…