Authentication
TraderBro uses API keys to authenticate all requests.
Step 1 — Generate an API key
- Log in at app.traderbro.com
- Go to Settings → API Keys
- Click Generate New Key
- Copy the key — it starts with
tb_sk_
Step 2 — Configure the CLI
Run the interactive setup:
traderbro configure --server https://api.traderbro.com --key tb_sk_YOUR_KEY_HERE
This saves your credentials to ~/.traderbro/config.yaml.
Step 3 — Verify
traderbro whoami
You should see your account details:
Email: you@example.com
Plan: Pro
Environment variables
For CI pipelines, scripts, and AI agents, use environment variables instead of the config file:
export TRADERBRO_SERVER="https://api.traderbro.com"
export TRADERBRO_API_KEY="tb_sk_..."
Environment variables take precedence over the config file.
Per-command key override
You can override credentials for a single command using global flags:
traderbro analyst list --server https://api.traderbro.com --key tb_sk_... --json
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
exit code 2 | Authentication failure | Check your API key is valid and not expired |
loading config: ... | Config file missing | Run traderbro configure |
| Connection refused | Wrong server URL | Confirm --server points to https://api.traderbro.com |
Next: First Command