Alpaca
Alpaca lets Mobius assistants run brokerage custody onboarding, KYC document uploads, ACH bank linking and transfers, position and ledger queries, and approval-gated order execution across Broker Sandbox and Paper Trading.
An Alpaca integration connects Mobius to Alpaca's Broker API (/v1)
and Trading API (/v2) so assistants can manage multi-account brokerage
custody workflows—opening client sub-accounts, uploading KYC and W-8BEN
documents directly from the Mobius Library, linking bank accounts via Plaid
processor tokens, initiating ACH transfers, reviewing positions and ledger
fills, and staging rebalancing orders under human approval.
Alpaca offers free, instant self-serve credentials for both Broker API
Sandbox (broker-api.sandbox.alpaca.markets, multi-account custody) and
Paper Trading (paper-api.alpaca.markets, single-account trading with
virtual cash). Real-money production modes (live and broker_live) are
blocked by default behind an explicit server kill switch
(ALPACA_ALLOW_LIVE=true).
Capability map
| Capability | Value |
|---|---|
| Provider ID | alpaca |
| Auth kind | api_key |
| Connect flow | Inline api_key, api_secret, and api_mode |
| Actions | Yes |
| Events | No |
| Webhook delivery | No |
| Event samples | No |
| Live status | Yes |
API modes and live-trading guard
api_mode | Fixed upstream host | Auth method | Account scope |
|---|---|---|---|
broker_sandbox | https://broker-api.sandbox.alpaca.markets | HTTP Basic (api_key:api_secret) | Multi-account (default) |
paper | https://paper-api.alpaca.markets | APCA-API-KEY-ID / APCA-API-SECRET-KEY | Single account |
live | https://api.alpaca.markets | APCA-API-KEY-ID / APCA-API-SECRET-KEY | Single account (gated) |
broker_live | https://broker-api.alpaca.markets | HTTP Basic (api_key:api_secret) | Multi-account (gated) |
- Fixed-host routing: Mobius maps
api_modestrictly through a closed host allowlist and refuses redirects so credentials never leave Alpaca's canonical origins. - Live-trading kill switch:
liveandbroker_liveconnections are rejected at connect time, live-status checks, and action execution unless the server explicitly setsALPACA_ALLOW_LIVE=true. - Capability isolation: Alpaca connections use Mobius's capability account
model (
IdentityConfigKeyis empty), so an assistant cannot switch between a sandbox connection and a live connection on its own—each assistant or routine runs strictly on the connection granted to it.
Connect Alpaca
| Surface | Support |
|---|---|
| App | Open Settings > Integrations, choose Alpaca, and enter your api_key, api_secret, and api_mode (broker_sandbox or paper). |
| CLI | The mobius CLI does not connect Alpaca yet. Use the app or API. Inspect actions with mobius catalog get-action alpaca.account.list. |
| API | Call POST /v1/integrations with provider alpaca and credentials of { "api_key": "...", "api_secret": "...", "api_mode": "broker_sandbox" }. |
- Broker Sandbox (multi-account custody): Sign up at
Alpaca Broker Dashboard, open API /
Devs, and generate your sandbox correspondent
API_KEYandAPI_SECRET. Chooseapi_mode: "broker_sandbox". - Paper Trading (single-account testing): Sign up at
Alpaca App, generate Paper API keys, and
choose
api_mode: "paper". - In Mobius, open Settings > Integrations, select Alpaca, paste your
api_keyandapi_secret, and select the matchingapi_mode.
Before saving, Mobius validates the credentials live against Alpaca (GET /v1/accounts?limit=1 for Broker modes or GET /v2/account for Trading modes).
Invalid keys are rejected without saving, and api_key and api_secret are
stored exclusively in encrypted integration credentials—never in plaintext
config or error logs.
Actions
alpaca.account.list
alpaca.account.get
alpaca.account.create
alpaca.document.upload
alpaca.ach_relationship.create
alpaca.transfer.create
alpaca.position.list
alpaca.activity.list
alpaca.order.create
alpaca.order.cancelFour actions are read-only and idempotent (alpaca.account.list,
alpaca.account.get, alpaca.position.list, and alpaca.activity.list). All
six financial and compliance write actions (alpaca.account.create,
alpaca.document.upload, alpaca.ach_relationship.create,
alpaca.transfer.create, alpaca.order.create, and alpaca.order.cancel) are
marked destructive, so assistants running with the default destructive
approval mode pause for human approval before executing them.
How the tools behave
- Dual-mode Broker and Trading support. In
broker_sandboxandbroker_live, passaccount_idto account, position, order, and custody tools. Inpaperandlive, omitaccount_idon read and order actions; Broker-only actions (account.create,document.upload,ach_relationship.create,transfer.create) fail immediately without calling Alpaca when run on a Trading connection. - Exact decimal strings. Every cash balance, buying power figure, equity total, share quantity, notional amount, order price, fee, and unrealized P&L value is preserved as an exact decimal string to eliminate floating-point rounding drift.
- Direct Mobius Library KYC uploads.
alpaca.document.uploadaccepts either a Mobius Libraryartifact_id(streaming bytes directly from the Library and recording a delivery audit entry without placing file contents in the conversation) or standard base64 viacontent_base64. Decoded uploads are capped at 10 MiB. - Plaid processor token ACH linking and account masking.
alpaca.ach_relationship.createaccepts either a Plaidprocessor_tokenor direct US routing and account numbers (mutually exclusive). Outputs always mask the bank account number to its last four digits (****1234) and never echo raw bank account numbers or processor tokens. - PII-minimized onboarding summaries.
alpaca.account.createsubmits CIP identity details and signed legal agreements to Broker APIPOST /v1/accountswhile returning only non-PII summary fields (account_id,account_number,status,currency,created_at) and scrubbing SSN/DOB fields from errors. - Order validation and idempotency.
alpaca.order.createenforcesqtyXORnotionalas positive decimal strings, requireslimit_priceonlimit/stop_limitorders andstop_priceonstop/stop_limitorders, and supportsclient_order_idso retries cannot place duplicate orders. - Live status checks. Use Test connection on the Alpaca account page
(or the live-status API endpoint) to confirm that stored credentials are still
accepted by Alpaca for the configured
api_mode.
Events
Alpaca does not register source events or push webhooks in Mobius (Alpaca's
Broker API uses Server-Sent Events rather than outbound HTTP webhooks). Poll
fills and ledger updates on a schedule with alpaca.activity.list and
next_page_token.
Next
- Grant Alpaca access to specific assistants from Connect accounts.
- Save daily position or ledger snapshots to tables or automate portfolio monitoring with routines.
- Review how destructive approvals protect financial writes in actions.