Skip to main content

Authentication

TraderBro uses API keys to authenticate all requests.

Step 1 — Generate an API key

  1. Log in at app.traderbro.com
  2. Go to Settings → API Keys
  3. Click Generate New Key
  4. 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

ErrorCauseFix
exit code 2Authentication failureCheck your API key is valid and not expired
loading config: ...Config file missingRun traderbro configure
Connection refusedWrong server URLConfirm --server points to https://api.traderbro.com

Next: First Command