DocsIntegrations

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

CapabilityValue
Provider IDalpaca
Auth kindapi_key
Connect flowInline api_key, api_secret, and api_mode
ActionsYes
EventsNo
Webhook deliveryNo
Event samplesNo
Live statusYes

API modes and live-trading guard

api_modeFixed upstream hostAuth methodAccount scope
broker_sandboxhttps://broker-api.sandbox.alpaca.marketsHTTP Basic (api_key:api_secret)Multi-account (default)
paperhttps://paper-api.alpaca.marketsAPCA-API-KEY-ID / APCA-API-SECRET-KEYSingle account
livehttps://api.alpaca.marketsAPCA-API-KEY-ID / APCA-API-SECRET-KEYSingle account (gated)
broker_livehttps://broker-api.alpaca.marketsHTTP Basic (api_key:api_secret)Multi-account (gated)
  • Fixed-host routing: Mobius maps api_mode strictly through a closed host allowlist and refuses redirects so credentials never leave Alpaca's canonical origins.
  • Live-trading kill switch: live and broker_live connections are rejected at connect time, live-status checks, and action execution unless the server explicitly sets ALPACA_ALLOW_LIVE=true.
  • Capability isolation: Alpaca connections use Mobius's capability account model (IdentityConfigKey is 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

SurfaceSupport
AppOpen Settings > Integrations, choose Alpaca, and enter your api_key, api_secret, and api_mode (broker_sandbox or paper).
CLIThe mobius CLI does not connect Alpaca yet. Use the app or API. Inspect actions with mobius catalog get-action alpaca.account.list.
APICall POST /v1/integrations with provider alpaca and credentials of { "api_key": "...", "api_secret": "...", "api_mode": "broker_sandbox" }.
  1. Broker Sandbox (multi-account custody): Sign up at Alpaca Broker Dashboard, open API / Devs, and generate your sandbox correspondent API_KEY and API_SECRET. Choose api_mode: "broker_sandbox".
  2. Paper Trading (single-account testing): Sign up at Alpaca App, generate Paper API keys, and choose api_mode: "paper".
  3. In Mobius, open Settings > Integrations, select Alpaca, paste your api_key and api_secret, and select the matching api_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.cancel

Four 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_sandbox and broker_live, pass account_id to account, position, order, and custody tools. In paper and live, omit account_id on 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.upload accepts either a Mobius Library artifact_id (streaming bytes directly from the Library and recording a delivery audit entry without placing file contents in the conversation) or standard base64 via content_base64. Decoded uploads are capped at 10 MiB.
  • Plaid processor token ACH linking and account masking. alpaca.ach_relationship.create accepts either a Plaid processor_token or 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.create submits CIP identity details and signed legal agreements to Broker API POST /v1/accounts while 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.create enforces qty XOR notional as positive decimal strings, requires limit_price on limit/stop_limit orders and stop_price on stop/stop_limit orders, and supports client_order_id so 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.