LL-126: Alpaca API Credentials Invalid - 401 Unauthorized
ID: LL-126
Date: 2026-01-09
Severity: CRITICAL
Category: Operations/API
Executive Summary
Both the GitHub Secrets AND the credentials provided by CEO are returning 401 Unauthorized from Alpaca API.
Evidence
From GitHub Actions workflow logs:
401 Client Error: Unauthorized for url: https://paper-api.alpaca.markets/v2/account
alpaca.common.exceptions.APIError: {"message": "unauthorized."}
Credentials Tested
- GitHub Secrets (ALPACA_PAPER_TRADING_5K_API_KEY): FAILED
- CEO-provided credentials: FAILED
Root Cause
The Alpaca API credentials are invalid. Possible reasons:
- Keys were regenerated in Alpaca dashboard after being saved
- Paper trading account was reset/closed
- Keys are for wrong account type (live vs paper)
- Keys expired or were revoked
Resolution Required
- Log into https://app.alpaca.markets
- Navigate to Paper Trading account
- Verify paper trading is enabled
- Regenerate API keys if needed
- Update GitHub secrets with new keys
Impact
- Paper trading has been broken since Jan 6 (4 days)
- No trades can execute until credentials are fixed
- System health checks fail at Alpaca connectivity step
Prevention
- Add credential expiration monitoring
- Test credentials weekly even without trades
- Alert when credentials fail validation
Tags
alpaca #api #unauthorized #credentials #critical #ll-126
This lesson was auto-published from our AI Trading repository.
More lessons: rag_knowledge/lessons_learned
Top comments (0)