Skip to content

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)
Practise first, with no real money(3)

Steps

  1. 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)

  2. 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)

  3. 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)

  4. 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)

  5. 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

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)

Other brokers and exchanges