Alpaca is the broker developers reach for when they want to point code at the US market, and that makes it the natural first home for a trading agent. It's an API-first brokerage with commission-free stocks and ETFs, options, and crypto — but the feature that matters most for an AI agent is the one that costs nothing: a free **paper trading** environment with the exact same API as live, running on fake money. That's a real on-ramp. You can wire up the whole stack, watch your [OpenClaw](https://openclaw.direct) agent place a hundred orders, and lose precisely zero dollars while you learn how it behaves. This guide walks the full setup: sign up for OpenClaw Direct, generate paper keys, wire an Alpaca MCP, bolt on a safety skill, and only then graduate, deliberately, toward real money.

TL;DR

Alpaca is an API-first US brokerage — commission-free stocks and ETFs, options, and crypto, with a first-class REST/WebSocket API and a free paper trading sandbox that mirrors the live API exactly. That sandbox is why you start here. Setup: sign up at [openclaw.direct/users/sign\_up](https://openclaw.direct/users/sign_up), provision an Instance, generate **paper** API keys (not live), store them scoped in the OpenClaw Direct vault, wire the [Alpaca MCP](/mcp-guide/what-is-model-context-protocol-mcp), attach a persistent [safety skill](/blog/ai-agent-safety-tips) (per-trade caps, symbol whitelist, no live-key access), and run entirely on paper first. Add [Telegram approvals](/blog/safety-rails-openclaw-trading-agents), then go live small. Equities trade market hours; crypto trades 24/7.

## Why an Always-On Market Needs a Hosted Agent

Here's the thing an agent changes about Alpaca: it removes the human from the loop, and a market doesn't wait for you to open your laptop. US equities trade during market hours, but Alpaca crypto trades 24/7 — around the clock, every day, including the 3am when your machine went to sleep. An agent built to watch that market only helps if it's actually watching. A bot that runs when your laptop is awake is a bot that misses the move that mattered.

So where should that agent live? Not on your laptop. Your personal machine sleeps, reboots for updates, drops off Wi-Fi at cafes, and keeps your API keys in a config file sitting next to your browser. None of that is acceptable for software that can place orders against a brokerage account. The failure modes aren't hypothetical — they're Tuesday.

OpenClaw Direct runs every agent on its own dedicated machine, isolated from every other user, with your Alpaca keys encrypted at rest inside the platform's credential vault instead of a plaintext file on your disk. The infrastructure holds 99.9% uptime with 24/7 monitoring, so the agent keeps watching a market that never fully rests, and you can suspend or terminate it from any browser on any device. For a program that talks to real money, that's the right amount of surface area — and the right size of blast radius when something goes wrong.

## What Is Alpaca, and How Do Agents Plug Into It?

Alpaca is a US brokerage built API-first: instead of a mobile app with an API bolted on, the API _is_ the product. It offers commission-free trading in stocks and ETFs, options, and crypto, all reachable through a clean REST and WebSocket interface. Developers picked it long before AI agents existed, which means the surface an agent needs — order placement, positions, account data, market data — is mature and well-documented rather than reverse-engineered.

For an AI agent, the connection point is an [MCP](/mcp-guide/what-is-model-context-protocol-mcp) server that wraps Alpaca's API and exposes its actions as tools your agent can call in plain language. You reach Alpaca either directly through its API or through an MCP that fronts it — Alpaca publishes an [official open-source MCP server](https://github.com/alpacahq/alpaca-mcp-server) (`alpacahq/alpaca-mcp-server`) that covers account info, positions, stock and options orders, and market data. Whichever route you take, the pattern is the one from our [MCP explainer](/mcp-guide/what-is-model-context-protocol-mcp): one server, a menu of tools, a standard handshake. The agent connects, sees the tools it's allowed to call, and, for now, shouldn't call the trading ones at all.

This is a very different feel from a retail app like Robinhood, where the agentic account is a consumer-facing product with guardrails baked into the account itself (we cover that flow in [setting up OpenClaw with Robinhood](/blog/set-up-openclaw-to-trade-on-robinhood)). Alpaca hands you the raw API and trusts you to build the guardrails. That's more power and more responsibility — which is exactly why the paper environment matters so much.

## Paper Trading: Alpaca's Best Safety Feature

This is the step that makes Alpaca the safest broker to hand an agent, so internalize it before you touch a live key. Alpaca gives every account a free **paper trading** environment: identical API, identical order types, identical market data — fake money. Your agent can't tell it isn't live, which is precisely the point. Every mistake it's going to make, it makes here first, for free.

The practical difference is a separate set of keys and a separate base URL. Paper keys point at Alpaca's paper endpoint; live keys point at the real one. The API calls are otherwise the same, so code — and an agent — written against paper runs unchanged against live. That means you get to exercise the entire stack end to end, MCP and safety skill and Telegram approvals included, with the worst-case outcome being a fake loss and a lesson.

Treat paper as a gate, not a formality. The temptation is to skim a day of paper trading and flip to live because the returns looked good. Resist it. Paper trading is where you find out that your agent over-trades on choppy days, or misreads a limit order, or wants to buy something absurd it saw trending. Those discoveries are cheap now and expensive later. Run it long enough that its behavior stops surprising you.

## What Can Your Agent Actually Do — and What Should It Not?

Through an Alpaca MCP, an agent can read your full account (buying power, positions, open orders, PnL) and act on it: place market and limit orders in stocks, ETFs, options, and crypto, and manage or close positions. The read side is nearly free and nearly risk-free. The trade side is where a careless agent turns a bad idea into a filled order. Respect that gradient, and walk it from left to right.

- **Read and analyze (paper or live).** Pull positions, scan market data, check buying power, and write a brief on what it _would_ do. Start — and stay a while — here.
- **Trade on paper.** Let it place real order flow against fake money. This is where it earns your trust, or shows you it hasn't yet.
- **Small live stock and ETF orders.** A modest position in a liquid, blue-chip name is the right first live action once paper looks sane.
- **Options.** Defined-risk, income-style strategies — see our [covered-call income skill](/blog/covered-call-income-skill) for a concrete starting point — before anything with open-ended risk. Options add assignment, expiry, and leverage-like payoffs the agent must reason about.

One equities-specific consideration before you scale up frequency: the [pattern day trader (PDT) rule](/blog/pdt-rule-and-your-trading-agent) historically capped margin day-trading. FINRA has since retired it — Alpaca replaced the old $25,000-and-round-trip regime with a real-time intraday margin framework on June 4, 2026, and other brokers are phasing the change in through 2027 — but an over-eager agent can still trip live intraday margin and buying-power limits, and orders that would create a margin deficit are now rejected pre-trade. Cap its activity deliberately. The safety skill in the next section is where all of these limits live.

## The Setup, Step by Step

### Step One: Sign Up for OpenClaw Direct and Provision Your Instance

Go to [openclaw.direct/users/sign\_up](https://openclaw.direct/users/sign_up) and create an account. The Advanced plan ($29/month, "Most Popular") is the right starting point for trading workloads — 4 GB of dedicated RAM and unlimited AI models, so you're not rationing calls while your agent watches the market. Every subscription includes free trial credits, enough to wire the whole thing up and watch a stack of paper orders fill before you commit a cent. Create a new Instance, name it something like "Alpaca Agent," and click "Start Provisioning." While it builds, move to Step Two.

### Step Two: Generate Alpaca Paper Trading Keys (Not Live)

Log in to Alpaca and open the dashboard. Switch to the **paper trading** environment first — this is the whole safety strategy, so do it deliberately — and generate an API key and secret there. These paper keys point at Alpaca's paper endpoint and control nothing but fake money, which makes them the perfect credential to hand a brand-new agent. Copy the key and secret; you'll paste them into OpenClaw Direct in Step Three. Leave your live keys ungenerated for now. There is no reason for a live key to exist until your agent has earned one on paper.

### Step Three: Wire the Alpaca MCP Into Your Instance

With your Instance provisioned, add the Alpaca MCP to its server list — Alpaca's official `alpaca-mcp-server` is the straightforward choice. Supply the **paper** key and secret from Step Two, which get stored in the OpenClaw Direct credential vault, scoped to your Instance and never written to a personal disk. Point the agent at the MCP. The MCP is model-agnostic, so you're not locked to one provider — use whichever model you already trust. Once connected, your agent can see the Alpaca tools it's allowed to call. It just shouldn't call the trading ones until Step Four is in place.

### Step Four: Attach a Safety Skill (Don't Skip This)

Wiring the MCP gives your agent the _capability_ to trade. It does not give it the _judgment_ to trade well. Before it places a single order, attach a small persistent [safety skill](/blog/ai-agent-safety-tips) to your Instance from the Skills card. A sensible Alpaca starting set:

- A per-trade notional cap and a rolling daily volume cap.
- A symbol whitelist — only the tickers you actually want traded (say SPY, QQQ, AAPL), nothing the agent found trending.
- A day-trade throttle that respects your account's day-trading and intraday margin limits. (FINRA's [PDT rule](/blog/pdt-rule-and-your-trading-agent) is being retired in favor of real-time intraday margin — Alpaca switched on June 4, 2026 — but buying-power limits can still reject orders, so the agent shouldn't trade its way into one.)
- A hard rule that the agent uses **paper keys only** until you explicitly promote it, and never touches a live key on its own.
- A rule to read buying power and open positions before every action, to avoid over-committing or stacking positions.

This lives in a skill, not a chat instruction, because chat instructions vanish when the agent's memory is compacted — persistent rules belong in persistent files. A skill survives every conversation, restart, and model swap. Our [safety rails hub](/blog/safety-rails-openclaw-trading-agents) collects the full set of guardrails worth layering in; treat the list above as the floor, not the ceiling.

### Step Five: Run on Paper, Then Add Approvals, Then Go Small and Live

Give your agent a bounded first task on paper. From the OpenClaw Direct dashboard, ask it to read your paper account, pull current market context, and place a few small paper orders — then report what it did and why. This costs nothing, exercises the MCP end to end, and shows you how the agent reasons and acts before a real dollar is ever at stake. Run that loop for days, not minutes. Sensible behavior on paper is your evidence; anything weird catches a problem while it's still free.

When paper looks boringly consistent, add a human checkpoint before you touch live money. Wire a [Telegram approval](/blog/safety-rails-openclaw-trading-agents) on every trade so you get a preview — symbol, side, quantity, order type, estimated cost — with confirm and reject buttons before anything routes. Only then generate a live key, store it in the vault, promote the agent in your safety skill, and keep the first real order tiny: a small position in a liquid name. Expand into scheduled strategies with cron only once the plumbing has earned that trust. Never before.

## What Happens When Something Goes Wrong

Every serious agentic setup has to answer one question: when your agent does something you don't want, how fast can you stop it? With Alpaca on OpenClaw Direct you have layered kill switches, and the first one is instant.

Your fastest is the OpenClaw Direct dashboard: suspend or terminate the Instance from any browser, on any device. Because the Alpaca keys live in the platform vault rather than on your laptop, killing the Instance means no process can route a new order. Your second is at the broker: regenerate or revoke your API keys in the Alpaca dashboard, and the old credentials stop working no matter what any process tries. And your structural safety net for the entire learning phase is simply that the keys are _paper_ keys — a runaway agent on paper can do nothing but lose imaginary money and teach you something real.

The harder truth is what a kill switch can't undo. An order that already filled is filled; there's no reversing a live trade because you hit the button a second too late. That's why the per-trade caps, the symbol whitelist, and the paper-first discipline in your safety skill do the heavy lifting, and why the size of the live account — not the kill switch — is your real limit on the downside. The rule that matters most stays simple: fund the live account only with money you can lose without rearranging your life, and don't promote off paper until you've earned the right to.

Ready to run an Alpaca agent the safe way?

Start on paper with OpenClaw Direct. Free trial credits included with every subscription.

[Run OpenClaw Now](https://openclaw.direct/users/sign_up)

Important disclaimer — please read

**Educational content only, not financial advice.** This article is provided by OpenClaw Direct for general informational and educational purposes only. It is not, and must not be relied upon as, financial, investment, trading, legal, tax, or accounting advice, nor a recommendation, solicitation, or offer to buy, sell, or hold any security, event contract, derivative, cryptocurrency, or other instrument. It is general in nature and does not account for your personal circumstances, objectives, or financial situation.

**No advisory relationship.** Reading this content, using our software, or contacting us does not create any advisor-client, broker-dealer, fiduciary, or other professional relationship. OpenClaw Direct is not a registered investment adviser, broker-dealer, futures commission merchant, or commodity trading advisor, and nothing here is personalized advice.

**Substantial risk of loss.** Trading and investing — particularly in prediction markets, event contracts, derivatives, and cryptocurrencies — involve a high degree of risk and are not suitable for everyone. You can lose some, all, or (in leveraged positions) more than the capital you commit, so only ever risk money you can afford to lose entirely. Past performance is not indicative of future results, and no representation is made that any strategy, account, or bot will achieve profits or avoid losses.

**Automated and AI-driven trading carries additional risk.** Trading bots and AI agents can and do fail. They may place erroneous, delayed, duplicated, or unintended orders; misread market data; behave unexpectedly during volatility or outages; or fail to execute at the expected time or price. If you configure or deploy any bot or agent based on this content, you do so entirely at your own risk and are solely responsible for monitoring it and for every order it places.

**Do your own research and consult a professional.** Before making any financial decision or deploying any automated strategy, conduct your own independent research and consult a licensed financial advisor — and, where relevant, a legal or tax professional — about your specific situation.

**Eligibility, jurisdiction, and legal compliance are your responsibility.** Prediction markets and event contracts are not legal or available everywhere; they are restricted or prohibited in certain jurisdictions and U.S. states, and their status keeps changing. Some platforms restrict access by residency (for example, Polymarket's international platform is not available to U.S. persons). You must be of legal age and eligible to trade, and it is solely your responsibility to determine whether your use of any platform, product, or strategy described here is lawful where you live and to comply with all applicable laws, regulations, and platform terms of service.

**Limitation of liability.** To the maximum extent permitted by law, OpenClaw Direct, its affiliates, and its contributors accept no liability for any loss or damage — including any loss of capital or profits — arising directly or indirectly from your use of, or reliance on, this content or any tool, bot, or strategy described in it. You act on this information entirely at your own risk.

* * *

**Sources:** [Alpaca Docs — Paper Trading](https://docs.alpaca.markets/docs/paper-trading), [Alpaca Docs — Trading API](https://docs.alpaca.markets/docs/trading-api), [GitHub — alpacahq/alpaca-mcp-server](https://github.com/alpacahq/alpaca-mcp-server), [Alpaca Docs — Crypto Trading](https://docs.alpaca.markets/docs/crypto-trading), and [FINRA — Day Trading and the Pattern Day Trader Rule](https://www.finra.org/investors/investing/investment-products/stocks/day-trading).

