Skip to main content

lium init

Run first-time setup: authenticate in the browser, then save your API key and configure your SSH key locally.

lium init [OPTIONS]

By default lium init opens your browser to authenticate. On a machine with no browser you have two choices:

  • You already have an API key (from Access → API Keys on lium.io, or from POST /api/auth/signup): export it and skip init — every command and the SDK read LIUM_API_KEY, and the SSH key is generated on first use.
    export LIUM_API_KEY=sk_...
    lium balance --json # {"balance": 12.34, "balance_usd": 12.34, "currency": "USD"} — the key works
  • You have an account but no key: the two-step flow with --no-browser and --session — a human opens the URL once.

With no key and no terminal, plain lium init behaves like --no-browser: it prints the URL and the session ID and exits 0.

The key lium init saves​

Each browser login issues a new API key for that CLI only. It has the read, rent and manage scopes (not billing) and expires after 365 days by default. It shows under Access → API Keys with a name starting lium CLI and the login date, so you can revoke one machine's key without touching the others. Logging in again on the same install replaces that install's previous key, once the CLI sends an install id. A previous key that has a budget and live pods is kept, so its budget still stops those pods.

Options​

FlagEffect
--no-browserPrint the auth URL and a session ID (step 1 of headless auth). Open the URL in a browser; the session ID is not a link.
--session IDVerify a pending auth session and save the API key (step 2 of headless auth)

Examples​

lium init # Opens the browser to authenticate
lium init --no-browser # Prints the auth URL + session ID
lium init --session <ID> # Verifies that session and saves the API key
LIUM_API_KEY=sk_... lium balance --json # Headless with a key you already hold: no init needed

See also​