Skip to content

Guide

Why does Nyria say Alpaca didn't accept these keys?

Alpaca didn't accept these keys means Alpaca refused the key ID and secret you pasted. The usual causes are a trailing space copied with the secret, a key regenerated after you copied it, or a live key under Connect paper account. Generate a fresh pair in the matching environment and paste it again.

Official documentation

Fix Alpaca didn't accept these keys

  1. 1

    Check the environment

    Confirm the Alpaca dashboard was on Paper or Live when you generated the key.

  2. 2

    Match the button

    Pick the paper option for a paper key and the live option for a live one.

  3. 3

    Generate a new pair

    In Alpaca, select Generate New Keys and copy both values.

  4. 4

    Paste without spaces

    Paste the key ID and the secret, with no space at either end.

  5. 5

    Check the account number

    Paper account numbers start with PA.

The usual causes

  • A trailing space copied with the secret.
  • A key regenerated in Alpaca after you copied it.
  • A key from the other environment.

Paper and live keys

  • A paper key only works on paper.
  • A live key only works on live.
  • Alpaca shows the secret once, so copy it straight away.

A new signup

  • The dialog may say Alpaca has no account for these keys yet.
  • Alpaca may still be creating the PA account.
  • Wait a few minutes and try again.

Keep keys safe

  • Alpaca API keys can trade.
  • Never share them.
  • Removing the account in Nyria deletes Nyria's copy, but the key works until you regenerate it.

Questions

Why does Alpaca refuse my keys?
Usually a trailing space, a regenerated key or the wrong environment.
Can a live key connect as paper?
No. A paper key only works on paper and a live key only on live.
Where do I find my secret key again?
You cannot. Alpaca shows it once, so generate a new pair.
What does the PA prefix mean?
Alpaca paper account numbers start with PA.
Does removing the account revoke the key?
No. The key works until you regenerate it at Alpaca.

Next

Try a paper bot first

No card required. Paper is free. Live trading from $15 a month.