401 Error in the API

I’ve been papertrading for a few days and have been able to make requests through the api up until today. I’ve started getting a 401 error “request not authorized”. I’ve regenerated keys and sent requests through Postman to make sure I’m not going crazy but I haven’t been able to make it work. Ideas?

1 Like

I was in the same problem, but finally got the paper trading to work by adding the baseUrl and removing the paper: true

const alpacaPaper = new Alpaca({
  keyId: process.env.PAPER_API_KEY,
  secretKey: process.env.PAPER_SECRET_API_KEY,
  baseUrl: 'https://paper-api.alpaca.markets',
})