API guide · Alpaca Trading API (United States)

Connect your Alpaca account

Get the account connection keys and add them to Demeter. Live orders have not yet been verified.

  1. 01alpaca.markets › Sign up
    Alpaca sign-up form — Create your Trading API account with name, country of tax residence, email and password
    Source: Alpaca Learn (alpaca.markets/learn)

    Open an Alpaca account

    Create an account at alpaca.markets. A paper (simulated) account is ready immediately; a live brokerage account needs identity verification and funding. Alpaca charges no commission on US-listed stocks and ETFs.

  2. 02Dashboard › Paper / Live switch

    Pick the environment

    The dashboard has separate Paper and Live environments, each with its own keys. Start with Paper (Demeter's paper mode runs against Alpaca's paper endpoint) and switch to Live once you have watched it for a while.

  3. 03Dashboard › API Keys › Generate New Key
    Alpaca dashboard API Keys box — paper endpoint, Key and Secret, with the note that the secret disappears after leaving the page
    Source: Alpaca Learn (alpaca.markets/learn)

    Generate the keys

    In the dashboard's API Keys box press Generate New Key. You get an API Key ID and a Secret Key; the secret is shown only once, so copy both now. Regenerating invalidates the old pair.

  4. 04Live account › Funding

    Fund the live account

    For live trading, deposit USD by bank transfer in the dashboard. Demeter keeps its cash floor and never withdraws. Alpaca trading keys cannot move money out of the account.

  5. 05Demeter › Settings › Trading channels · API keys

    Paste into Demeter

    Settings › Trading channels · API keys › Alpaca: paste the Key ID and Secret, choose Paper or Live to match the keys, set the stock broker to Alpaca and save.

Menu names may shift slightly as each service updates. If a step blocks you, tell us on the contact page.

Where are the keys stored?

Keys are kept encrypted on your own computer; the unlocking key lives in the operating system keychain. Copying the files elsewhere does not open them, and the vendor cannot see them. Issue every key without withdrawal permission. Demeter never needs it.

Connecting another account?

FAQ

Questions about this key

Permissions, storage and lost keys, all in one place.

Brokers and exchanges See the questions

No program to paste the keys into yet?

Demeter is free to download and free to use. After installing, paste the keys above into Settings › Trading channels · API keys and you are connected.