Connect Alpaca to a trading bot
Stocks, ETFs, crypto · Paper or real money · facts last checked Oct 13, 2026
Connect an Alpaca live or paper account with an API key pair. Start with paper: it is free, open worldwide and uses no real money.
Tallimark connects to Alpaca today. You paste the key into your own account; Tallimark never holds your money.
Keep these OFF: they let a key move money out
- Crypto Wallets API access: Alpaca turns this on only on request. Never ask for it on an account a bot trades: the bot doesn't need it, and it lets a key move crypto out.
Before you start(6)
For a live account in the US you need to be 18 or older, have a Social Security number and a residential address in the 50 states or Puerto Rico.
Source: Alpaca support: account requirements (opens in a new tab) (checked Oct 11, 2026)
There is no minimum deposit for individual live accounts.
Source: Alpaca support: account minimums (opens in a new tab) (checked Oct 11, 2026)
Alpaca offers individual taxable accounts only (no retirement accounts). Every live account is a margin account; margin and short selling start at $2,000 of equity, and crypto is always traded with cash.
Source: Alpaca docs: account plans (opens in a new tab) (checked Oct 11, 2026)
Residents of Canada can't open a live account. If your country isn't in Alpaca's tax-residence list, you can use paper trading only.
Source: Alpaca: live accounts outside the US (opens in a new tab) (checked Oct 11, 2026) · Alpaca: connect to the Alpaca API (opens in a new tab) (checked Oct 11, 2026)
Crypto trading is open in some US states and some other countries only; check Alpaca's current list for your state before choosing crypto.
Not yet checked against the broker's own screen: names may differ slightly.
Why it isn't checked
Because Alpaca's current state list sits behind a link we couldn't load; an older support page lists 25 states. Don't rely on a list until it is re-read.
Source: Alpaca docs: crypto trading (opens in a new tab) (checked Oct 11, 2026) · Alpaca support: cryptocurrency (undated) (opens in a new tab) (checked Oct 11, 2026)
No separate API approval: the key works once your account is approved.
Source: Alpaca docs: authentication (opens in a new tab) (checked Oct 11, 2026)
Practise first, with no real money(3)
Anyone can open a paper-only account with just an email address. It starts with $100,000 of pretend money.
Source: Alpaca docs: paper trading (opens in a new tab) (checked Oct 11, 2026)
Paper and live are separate: each has its own key pair, and a live key doesn't work on paper (or the other way round). Pick the matching environment when you add the key.
Source: Alpaca docs: authentication (opens in a new tab) (checked Oct 11, 2026)
Alpaca no longer resets paper accounts: you create a new paper account instead, and a new paper account needs new keys.
Source: Alpaca docs: paper trading (opens in a new tab) (checked Oct 11, 2026)
Steps
Sign in at app.alpaca.markets. For paper keys, first switch to your Paper Trading account (the account picker at the top of the dashboard).
Source: Alpaca: start paper trading (opens in a new tab) (checked Oct 11, 2026)
Find the API Keys section on the dashboard and choose Generate New Keys.
More detail
Older Alpaca articles place this on the Home page.
Source: Alpaca docs: getting started (opens in a new tab) (checked Oct 11, 2026) · Alpaca: connect to the Alpaca API (opens in a new tab) (checked Oct 11, 2026)
Copy both values at once: the Secret Key is shown only once. Keep them in a password manager.
Source: Alpaca: API key security for builders (opens in a new tab) (checked Oct 11, 2026)
Check the exact button names on today's dashboard.
Not yet checked against the broker's own screen: names may differ slightly.
Why it isn't checked
Because the broker shows this screen only after you sign in, and no public page describes it.
Source: Alpaca docs: getting started (opens in a new tab) (checked Oct 11, 2026)
In Tallimark, open Connections, choose Alpaca (or Alpaca paper), paste the API Key into "API key id" and the Secret Key into "Secret key", and confirm the key is trade-only.
Source: Alpaca docs: authentication (opens in a new tab) (checked Oct 11, 2026)
Permissions at Alpaca
Leave off
- Crypto Wallets API access
Why each setting
Crypto Wallets API access (leave off): Alpaca turns this on only on request. Never ask for it on an account a bot trades: the bot doesn't need it, and it lets a key move crypto out.
Source: Alpaca docs: Crypto Wallets API (opens in a new tab) (checked Oct 11, 2026) · Alpaca: API key security for builders (opens in a new tab) (checked Oct 11, 2026)
What to paste into Tallimark
- API key id
- Alpaca calls it: API Key (sent as APCA-API-KEY-ID)
- The shorter, public half of the pair.
- Secret key
- Alpaca calls it: Secret Key
- Shown once by Alpaca. If you lost it, regenerate the pair and paste both again.
IP allow-list
Alpaca keys can't be limited to IP addresses (no Alpaca page mentions it), so keep the key private and regenerate it if it may have leaked.
Source: Alpaca: API key security for builders (opens in a new tab) (checked Oct 11, 2026)
What Tallimark checks: Tallimark checks the account is active and allowed to trade. Alpaca keys have no permission settings: per Alpaca a key can't start bank (ACH) deposits or wire withdrawals, but it can place and cancel orders, so you confirm the key is trade-only and guard it like a password.
Does the key expire? No date: it works until you replace it
Keys don't expire on a date; they stop working when you regenerate them (the old pair then gets 401).
Not yet checked against the broker's own screen: names may differ slightly.
Why it isn't checked
Because Alpaca's docs don't state an expiry either way; this is read from the regenerate instructions.
Source: Alpaca: API key security for builders (opens in a new tab) (checked Oct 11, 2026)
What Tallimark does: If Alpaca refuses the key on 3 bot cycles in a row (outages don't count), bots using it pause: they send no orders, not even exits, and nothing at Alpaca is canceled, so resting orders such as protective stops stay there and can still fill. A position with no stop resting at Alpaca is not being managed until the key works: check it at Alpaca and close it there if you need to. Connections shows it, and Tallimark emails every verified address on your account. Replace the key: the bots check their positions with Alpaca and resume on their own once it works.
If something goes wrong(6)
- 401 unauthorized
- Why: A paper key used for live, or a live key for paper, or a regenerated (old) key.
- Fix: Add the key under the matching environment, or generate a new pair and paste both values.
Source: Alpaca: common Trading API errors (opens in a new tab) (checked Oct 11, 2026) · Alpaca: API key security for builders (opens in a new tab) (checked Oct 11, 2026)
- 403 insufficient buying power
- Why: The order costs more than the cash or margin available; open orders also hold buying power.
- Fix: Lower the trade size, cancel stale open orders, or add funds.
Source: Alpaca: common Trading API errors (opens in a new tab) (checked Oct 11, 2026)
- 403 trade denied due to pattern day trading protection
- Why: A margin account under $25,000 made too many day trades.
- Fix: Trade less often intraday or hold more than $25,000. FINRA is replacing this rule; Alpaca hasn't published its switch-over date.
Source: Alpaca: common Trading API errors (opens in a new tab) (checked Oct 11, 2026) · Alpaca docs: FINRA's intraday margin rule (opens in a new tab) (checked Oct 11, 2026)
- 403 asset is not fractionable / 422 notional must be >= 1.00
- Why: Fractional orders work only for some assets and need at least $1.
- Fix: Order whole shares, or at least $1, for that symbol.
Source: Alpaca: common Trading API errors (opens in a new tab) (checked Oct 11, 2026)
- 422 fractional orders must be DAY orders
- Why: Fractional and extended-hours orders accept only some time-in-force choices.
- Fix: Use DAY for fractional orders, and limit orders (DAY or GTC) for extended hours.
Source: Alpaca: common Trading API errors (opens in a new tab) (checked Oct 11, 2026)
- 429 Too Many Requests
- Why: Alpaca allows 200 requests a minute per account.
- Fix: Fewer bots or slower intervals on that account.
Source: Alpaca support: API usage limits (opens in a new tab) (checked Oct 11, 2026)
Replacing a key, and other notes for Alpaca
Replacing a key: Generate the new pair at Alpaca, then use “Replace key” here straight away: live sessions on the old key fail their cycles until you do.
- A live stock bot reads its prices from your own Alpaca account. Alpaca's Algo Trader Plus market-data plan ($99/month when checked) gives every US exchange; on the free plan it decides on IEX prices (one exchange), and its record says so.
Source: Alpaca docs: market data plans (opens in a new tab) (checked Oct 06, 2026)
- Alpaca's paper environment doesn't simulate regulatory fees, dividends, market impact or queue position, and gives random partial fills about 10% of the time.
Source: Alpaca docs: paper trading (opens in a new tab) (checked Oct 06, 2026)
All sources (last checked Oct 13, 2026)
- Alpaca support: account requirements (opens in a new tab) · checked Oct 11, 2026
- Alpaca support: account minimums (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: account plans (opens in a new tab) · checked Oct 11, 2026
- Alpaca: live accounts outside the US (opens in a new tab) · checked Oct 11, 2026
- Alpaca: connect to the Alpaca API (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: crypto trading (opens in a new tab) · checked Oct 11, 2026
- Alpaca support: cryptocurrency (undated) (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: authentication (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: paper trading (opens in a new tab) · checked Oct 11, 2026
- Alpaca: start paper trading (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: getting started (opens in a new tab) · checked Oct 11, 2026
- Alpaca: API key security for builders (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: Crypto Wallets API (opens in a new tab) · checked Oct 11, 2026
- Alpaca: common Trading API errors (opens in a new tab) · checked Oct 11, 2026
- Alpaca docs: FINRA's intraday margin rule (opens in a new tab) · checked Oct 11, 2026
- Alpaca support: API usage limits (opens in a new tab) · checked Oct 11, 2026
- Alpaca: home page (opens in a new tab) · checked Oct 13, 2026
- Alpaca: register on Alpaca (opens in a new tab) · checked Oct 13, 2026
Broker screens change often: if a button has moved, follow Alpaca's own page.
Ready to build a bot?
Other brokers and exchanges
- Coinbase Advanced TradeCrypto · Real money
- KrakenCrypto · Real money
- TradierStocks, ETFs · Paper or real money
- WebullStocks, ETFs, crypto · Paper or real money
- moomooStocks, ETFs · Paper or real money
- GeminiCrypto · Paper or real money
- TradeStationStocks, ETFs, options, futures · Paper or real money
- Charles SchwabStocks, ETFs · Real money