BuyProxy logo
Log inSign up

CLI Ā· Account

buyproxy login

Save your API key so every command just works.

Usage

shell
$ buyproxy login [--key bp_key_…]

login stores your API key locally after checking it with BuyProxy, so you don't have to pass it every time. Both personal (bp_key_…) and reseller (bp_live_…) keys work; the CLI detects which and shows the right menu.

Options

OptionWhat it does
--key <key>Provide the key non-interactively instead of being prompted.

Plus the global options (--json, --key, --no-color, --help).

How it works

  1. Create a key under Dashboard → API keys (personal) or Dashboard → Reseller → API keys.
  2. Run buyproxy login and paste it — the characters are masked as you type.
  3. The CLI checks the format, then asks BuyProxy who the key belongs to. If it's rejected, nothing is saved.
  4. It's written to ~/.config/buyproxy/config.json (or $XDG_CONFIG_HOME/buyproxy/) with permissions 0600, readable only by you.

Prefer not to store a key at all? Set BUYPROXY_API_KEY in your environment instead — it's used automatically.

Examples

Interactive

shell
$ buyproxy login
example output
? Paste your API key ••••••••••••
āœ” Key verified
āœ” Logged in as you@example.com (pro plan)
  Saved to /home/you/.config/buyproxy/config.json

In CI

shell
$ echo "$BUYPROXY_API_KEY" | xargs buyproxy login --key

Or skip login entirely and export BUYPROXY_API_KEY for the job.

JSON output

--json prints { "ok": true, "email": …, "label": …, "kind": "personal" | "reseller" }.

Troubleshooting

You seeHow to fix it
That doesn't look like a BuyProxy API key.Keys start with bp_key_ (personal) or bp_live_ (reseller) followed by hex characters.
BuyProxy rejected that key.It may have been copied incompletely or revoked — create a fresh one.

Tips

  • On shared machines, prefer the environment variable and avoid --key, because command-line arguments can show up in process listings and shell history.

Was this page helpful?