Read time … min

AI-native runtime for Alpaca strategies

Author in Cursor, Claude Code or any AI IDE. Deploy from GitHub into a managed cloud runtime with first-class MCP control, logs and region selection.

By the TradingHost engineering team

Section 01 · At a glance

At a glance

Broker
Alpaca Securities LLC
Broker type
US-regulated retail broker, API-first
Asset class
US equities, US options, crypto
Asset coverage
US equities (NYSE, NASDAQ, NYSE ARCA, BATS, IEX listings), US listed options (single-leg and multi-leg, OCC-cleared), crypto (via Alpaca Crypto LLC subsidiary), fractional shares, ETFs.
Runtime model
Containerised strategy runtime
Deployment source
GitHub
Languages
Any language that runs in a container
Common integrations
alpaca-py (current Python SDK), alpaca-trade-api (legacy), alpaca-trade-api-js, native REST and WebSocket clients, NautilusTrader, custom connectors
AI workflow integration
MCP control surface for Cursor, Claude Code, GitHub Copilot and CLI agents
TradingHost role
Runtime, deployment, logs, health checks, region selection, MCP control
Alpaca role
Broker account, API access, market data, execution venue, custody, settlement, tax reporting
Regulators
Alpaca Securities LLC: SEC and FINRA registered broker-dealer (CRD 288257). SIPC member. Alpaca Crypto LLC: FinCEN-registered Money Services Business for crypto trading.
US retail
Yes. Paper and live trading both supported.
Affiliation
TradingHost is independent and is not affiliated with Alpaca Securities LLC or Alpaca Crypto LLC

Section 02 · What Alpaca offers

What Alpaca offers

Alpaca exposes a developer-first REST and WebSocket API covering US equities, US options and crypto under one credential. The Trading API and Market Data API are separate hosts. Paper and live environments share the same endpoint shapes and separate keys, so a paper-tested strategy promotes to live without rewrites. Specific endpoint paths, rate limit caps and data subscription tiers live in Alpaca's docs.

Markets and strategy patterns

  • Fractional-share-aware portfolio rebalancing
  • Single-leg and multi-leg US options strategies
  • Equities, options and crypto behind one unified Trading API
  • Paper-validated strategies that promote to live without code change
  • WebSocket streaming on quotes, trades and account events
  • Alpaca Crypto LLC spot crypto strategies (BTC, ETH and more)
  • Algo Trader Plus SIP-data systematic equity strategies

API surface

Product surfaces
Trading API v2 for US stocks, US options and crypto under a single credential. Market Data API serves quotes, trades and bars on a separate host. Paper and live environments use separate base URLs and separate keys; the same endpoint shapes serve both, so paper-tested code promotes to live without rewrites.
Connection methods
REST for orders, positions, account state, options chains and asset metadata. WebSocket streams for real-time market data (quotes, trades, bars) and for account-level trade updates. Crypto, equities and options share the same REST and WebSocket conventions, differing only by asset_class and endpoint path.
Authentication
API key ID and secret in the APCA-API-KEY-ID and APCA-API-SECRET-KEY request headers. Paper and live keys are issued separately; a paper key cannot place a live order. OAuth 2.0 is available for delegated applications (e.g. broker-front-end fintechs) rather than for individual strategy access.

For specifics, refer to Alpaca

Specific endpoints, rate limits, market data subscription tiers and options approval requirements live in Alpaca's documentation. Treat these as the source of truth.

Section 03 · Build with AI

Build your Alpaca strategy with AI

Pick an integration method, fork a TradingHost framework starter, and author your strategy in an AI IDE. Cursor, Claude Code, GitHub Copilot and CLI-based AI agents all work with the same GitHub-native deployment loop.

  • Native Alpaca REST and WebSocket

    Direct control over Alpaca account state, order endpoints and the Market Data API. Use any HTTP and WebSocket client your container can run.

  • alpaca-py

    The current official Python SDK from alpacahq. Covers Trading API, Market Data API, broker API, and crypto. Use this for new projects.

  • alpaca-trade-api (legacy)

    Older Python SDK, still maintained for existing strategies. Alpaca recommends migrating to alpaca-py for new development.

  • Custom or framework connector

    NautilusTrader, in-house engines, JavaScript and TypeScript via alpaca-trade-api-js, and any other framework that wraps Alpaca REST and WebSocket endpoints.

Library and framework support for Alpaca products

alpaca-py covers Alpaca's full surface (equities, options, crypto, paper trading) and is the recommended SDK for new projects. alpaca-trade-api remains maintained for existing strategies. NautilusTrader has a community-maintained Alpaca integration; confirm options coverage against the adapter's current docs before relying on it.

Library or frameworkUS equitiesUS optionsCryptoPaper
alpaca-pySupportedSupportedSupportedSupported
alpaca-trade-apiSupportedSupportedSupportedSupported
alpaca-trade-api-jsSupportedPartially supportedSupportedSupported
NautilusTraderSupportedPartially supportedSupportedSupported
Native REST + WebSocketSupportedSupportedSupportedSupported

✓ confirmed support per official SDK or adapter docs. "partial" indicates partial coverage at the adapter level; verify against the integration's current docs. "check SDK" indicates feature is SDK-version dependent. Workflow links target /workflows/ pages currently in authoring.

TradingHost does not force a library. It runs your project.

Author with AI

alpaca-py and alpaca-trade-api both work with AI IDEs. The TradingHost MCP control surface closes the loop: AI tools can inspect deployments, review logs and manage the runtime alongside you, never the trade execution path.

Section 04 · Run on TradingHost

Run your code on TradingHost

Alpaca provides the broker account, API access and execution venue. TradingHost provides the production environment where your Alpaca-connected strategy runs.

Instead of running strategy code on a laptop, desktop machine, generic VPS or manually configured server, you deploy from GitHub into a TradingHost-managed container runtime.

You

  • Your repo contains your code.
  • Your deployment defines how it runs.
  • Your strategy connects to Alpaca.

TradingHost

  • Keeps the runtime online.
  • Surfaces logs and health checks.
  • Region selection.
  • Controlled deployment surface.

Deployment flow

  1. STEP 01

    Connect GitHub

    Authorise TradingHost to access your GitHub account.

  2. STEP 02

    Link a repo or start from a starter

    Point TradingHost at your existing Alpaca strategy repo, or fork an alpaca-py starter for a working baseline.

  3. STEP 03

    Deploy into a TradingHost container

    Pick a region (US-East sits closest to US equities matching engines; EU works for European-session crypto), supply your Alpaca API key and secret as environment values, and deploy. TradingHost builds your container from the repo and runs your strategy on managed Kubernetes infrastructure. No local Docker install required.

  4. STEP 04

    Monitor logs and health

    Watch live logs, health and runtime state from the TradingHost dashboard. The same surface is reachable through MCP from any AI IDE, so Cursor, Claude Code or a CLI agent can read deployment state and manage the runtime alongside you. Trade execution stays on the strategy code path, not on MCP.

  5. STEP 05

    Update and redeploy

    Push changes to your GitHub main branch and TradingHost redeploys automatically. A paper-keyed deployment is the natural test environment before promoting to live keys.

Section 05 · Operational notes

Operational notes for Alpaca

Things that bite you when you actually run an Alpaca strategy in a containerised cloud runtime, not always in Alpaca’s docs, not in framework READMEs. Every claim below is quoted or paraphrased from Alpaca’s own documentation or a primary regulator source; the deployment-side guidance is from running these strategies on TradingHost.

  1. 01 · Auth headers

    APCA-API-KEY-ID and APCA-API-SECRET-KEY in request headers

    Alpaca authenticates Trading API requests with the API key ID and secret in the APCA-API-KEY-ID and APCA-API-SECRET-KEY headers. There is no separate signing step. OAuth 2.0 is a separate flow used by delegated applications (a fintech building on Alpaca for its customers), not by individual strategies. Paper and live keys are issued separately and are not interchangeable.

  2. 02 · Paper vs live

    Paper environment uses a different base URL and a different key

    Paper trading runs against paper-api.alpaca.markets. Live trading runs against api.alpaca.markets. WebSocket streaming endpoints differ similarly. Keys generated for paper cannot place orders against live and vice versa. The endpoint surface is otherwise identical, so paper-validated code promotes to live by swapping the base URL and key set. Keep paper and live secrets in separate TradingHost Secrets entries; never reuse one across environments.

  3. 03 · Market data tiers

    Basic (IEX only) versus Algo Trader Plus (full US SIP)

    Alpaca's default market data plan returns IEX-only quotes and trades, which is sufficient for many systematic strategies but is a partial book by definition. Algo Trader Plus is the paid SIP-level plan and unlocks consolidated tape data. Strategies that depend on top-of-book accuracy across all venues should declare an Algo Trader Plus subscription as a deployment prerequisite; strategies that work on IEX-only sampling do not.

  4. 04 · Fractional shares

    Use notional, not qty, for fractional orders, and check fractionable: true

    Alpaca supports fractional shares on a per-symbol basis. To buy a dollar amount rather than a share count, submit an order with notional rather than qty. Before submitting, check the asset metadata endpoint and confirm fractionable: true; not every listed symbol is fractionable. Cancelled fractional orders cannot be partially filled in the same way a whole-share order can, so error handling needs to account for the difference.

  5. 05 · Options approval

    Required separately from equities; approval level controls accepted strategies

    Options trading on Alpaca requires a separate approval step beyond equities onboarding. Approval level is exposed on the account endpoint; orders that exceed the approved level are rejected by Alpaca, not by TradingHost. Plan deployment around a strategy that fits inside your approved level, or upgrade approval with Alpaca before deploying. TradingHost cannot waive or upgrade options approval.

  6. 06 · Pattern Day Trader

    PDT applies to margin accounts under $25,000 per FINRA Rule 4210

    FINRA Rule 4210 marks a margin account as a Pattern Day Trader after four or more day trades within five business days, and restricts further day trading until equity reaches $25,000. Alpaca exposes the flag on the account endpoint (pattern_day_trader). The rule is enforced at the broker, not at the runtime. Strategies that day-trade frequently on margin accounts under the threshold need to plan around the restriction or fund the account above $25,000.

  7. 07 · Crypto entity

    Crypto trades through Alpaca Crypto LLC, a separate FinCEN-registered entity

    Spot crypto trading is offered by Alpaca Crypto LLC, a FinCEN-registered Money Services Business, not by Alpaca Securities LLC. From a strategy perspective the credential is the same and the order surface is exposed through the same Trading API; from a regulatory perspective the legal entity is distinct. SIPC coverage applies to the broker-dealer account, not to crypto holdings. State this clearly in any risk-disclosure copy you generate alongside the strategy.

Section 06 · Built for

Built for

TradingHost Alpaca runtimes are best suited to:

  • Developers building strategies in AI IDEs (Cursor, Claude Code)
  • Systematic equity and options traders
  • Quant developers moving from notebook to production
  • Python developers using alpaca-py
  • Retail traders graduating off broker GUIs (Robinhood, Webull, Power E*Trade)

Connecting GitHub and creating your first strategy is free.

Section 08 · FAQ

FAQ

No. TradingHost is independent and is not affiliated with Alpaca Securities LLC or Alpaca Crypto LLC.

No. TradingHost is a runtime for trading strategy code. Alpaca Securities LLC is the broker-dealer, registered with the SEC and FINRA (CRD 288257) and a SIPC member. Your account, custody, market access, settlement and tax reporting all sit with Alpaca.

No. Your strategy code connects to Alpaca and sends order instructions according to your own logic, account permissions and integration method. TradingHost provides the runtime where that code runs.

No. Alpaca API access is provided by Alpaca. You are responsible for your Alpaca account, API permissions, credentials and compliance with Alpaca's terms.

AWS and DigitalOcean give you raw compute. You handle OS updates, container orchestration, log shipping, secret rotation, region failover and uptime monitoring yourself. TradingHost gives you a managed runtime purpose-built for trading strategies: GitHub-native deployment, MCP-driven control from AI IDEs, log and health surfaces out of the box. If you want to operate the infrastructure yourself, AWS works. If you want the runtime as a managed service, TradingHost is the shorter path.

Yes. Alpaca's current Python SDK is alpaca-py; the older alpaca-trade-api is still maintained. Both run on TradingHost. JavaScript and TypeScript work via alpaca-trade-api-js.

Yes. TradingHost supports any language that can run inside a container. Alpaca ships alpaca-trade-api-js for JS and TS; other languages can call the REST and WebSocket endpoints directly.

Yes, subject to Alpaca options approval. Options are exposed through the same Trading API credential as equities and crypto. Approved level controls which strategies the broker accepts; TradingHost does not bypass options approval.

Yes. Crypto is provided by Alpaca Crypto LLC, a FinCEN-registered Money Services Business that is a separate legal entity from Alpaca Securities LLC. From a strategy perspective the Trading API credential is the same; from a regulatory perspective the entity is distinct.

Connect your GitHub repo containing the strategy code, link it to TradingHost, and deploy. Use a paper-keyed deployment as the test environment and promote to live keys once the strategy is stable. Linking GitHub and creating a strategy is free; runtime plans are listed on the pricing page.

In your GitHub-controlled secrets workflow. TradingHost reads them at runtime through GitHub repository secrets, environment secrets or your own approved secret-management process. TradingHost does not need custody of your APCA-API-KEY-ID and APCA-API-SECRET-KEY. See platform secrets for the full handling model.

No. Strategies should never need withdrawal or money-movement permissions. The API key only needs the scopes required for order placement and market data access.

Yes. TradingHost supports MCP-based control for AI IDEs including Cursor, Claude Code, GitHub Copilot and CLI-based AI agents. AI tools can inspect deployments, review logs, restart strategies and manage runtime workflows. MCP is a control and observability surface, not the trade execution path. See the MCP control surface for the full picture.

Yes, if you treat them as separate TradingHost strategies with separate secrets. Alpaca's paper environment uses different base URLs and different keys from live, so the deployments are isolated by configuration. The same source code can power both with different environment values.

No. The PDT rule (FINRA Rule 4210) is enforced by Alpaca, not by TradingHost. Margin accounts under $25,000 are subject to PDT restrictions on day trading. Your strategy should query the account endpoint and respect the pattern_day_trader flag.

No. Your 1099 forms come from Alpaca at year-end, not from TradingHost. TradingHost provides the runtime; Alpaca handles brokerage tax reporting.

No. SIPC covers your Alpaca brokerage account (up to $500,000, including $250,000 in cash) under SIPC member protection. TradingHost's runtime is not SIPC-insured because TradingHost is not a broker.

TradingHost runs in the EU and US-East regions. US-East is closest to US equities matching engines, which is the natural pick for most Alpaca strategies. See the regions page for routing and proximity details.

No. TradingHost is focused on production runtime and deployment. Backtesting belongs in your research stack, framework or AlgoBuilder.