API Keys
An API key lets the CLI, the SDK, an AI agent or your own scripts use Lium as you. To just rent a GPU and SSH in, use the dashboard (Quickstart).
Anyone with your key can rent pods billed to your account. Treat it like a password, and never put it in a public repo or a non-CVM pod.
Create a key
Open API Keys
In the sidebar, open Access, then API Keys.
Add a key
Click ADD NEW +, give it a Name (e.g. cli-laptop, claude-agent) and click ADD. Copy the key.

Use the key
Send it in the X-API-Key header:
export LIUM_API_KEY=sk_yjujqGP...full-key
curl https://lium.io/api/pods \
-H "X-API-Key: $LIUM_API_KEY"
For the CLI:
pip install lium.io # or: curl https://lium.io/install.sh | sh
lium init # guided login (or set LIUM_API_KEY in your env)
lium ps # list your pods
For the SDK, set LIUM_API_KEY in the environment. See API Authentication.
Scopes
Scopes limit what a key can do. They are set when you create the key and can't be changed later.
| Scope | Lets the key |
|---|---|
read | see all pods, nodes, templates, volumes and spend |
rent | create pods, templates and volumes |
manage | reboot, reset GPUs, edit or delete pods it did not rent; change or delete the account's volumes, templates, SSH keys and registry logins (with account pod visibility) |
billing | move money: top-ups, card payments, credit transfers to another account and Auto Top Up settings |
A key made without choosing gets read, rent and manage, never billing. In the dashboard, ticking a scope also ticks the ones above it in the list (billing ticks read, rent and manage); untick any of them if the key should not have it. Every key can always manage the pods it rented itself, and edit or delete the templates it created.
Create a scoped key from a signed-in session with POST /keys:
{"name": "claude-agent", "scopes": ["read", "rent"]}
GET /keys/scopes lists every scope and what it allows.
The billing scope
A key needs billing to pay or move money. It is never on by default. Pick it next to read, rent or manage for one key that both rents and pays, or alone for a key that can't see or rent pods. A key with billing is shown only once, when you create it. Its top-ups and credit transfers count toward its budgets, so they can stop it from renting more. Its pods are deleted on their own charges plus its credit transfers, never because of a top-up.
A key with billing can:
- Top up by card:
POST /payments/topupcharges a saved card, orPOST /stripe/create-checkout-sessionopens a checkout. - Set Auto Top Up:
PUT /users/me/auto-top-upwiththresholdandamount_to_top_up. Only a key without a budget can set it. - Turn Auto Top Up off:
DELETE /users/me/auto-top-up.
Pod visibility
Set "pod_visibility": "own" when you create a key and it sees only the pods it created. With "account" it sees every pod on the account.
Budgets
A key can have a daily, monthly and lifetime budget in USD (at least $1 each):
- A key at a budget can't rent a pod or create a volume (
402). A rental is also refused when the budget has no room left for the pod's first 15 minutes. - When spend reaches a budget, that key's running pods are deleted. Data outside a volume or backup is lost.
- A volume the key created counts too: its storage and downloads are the key's spend.
Set budgets with POST /keys, or change them later with PATCH /keys/{id} from a signed-in session:
API=https://lium.io/api
# at creation: $20 a day, $300 a month, $2000 over the key's life
curl -X POST $API/keys -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{"name": "agent-1", "scopes": ["read", "rent"], "daily_budget_usd": 20, "monthly_budget_usd": 300, "max_budget_usd": 2000}'
# later: raise the daily budget
curl -X PATCH $API/keys/$KEY_ID -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" \
-d '{"daily_budget_usd": 40}'
Delete a key
On the Access → API Keys row, click 🗑️ Delete. The key stops working at once. To rotate, delete it and create a new one.
Who did what on the account
Every pod event (created, rebooted, deleted, failed) is logged with the key that caused it. Read it with lium audit or:
curl -s https://lium.io/api/users/me/events -H "X-API-Key: $LIUM_API_KEY" \
| jq -r '.[] | "\(.created_at) \(.event_type) \(.event)"'
Key hygiene
- One key per agent or integration, so you can revoke one without the others.
- Give agents
ownvisibility and a budget. - No
billingunless the key's job is to pay. - Set an expiry for short-lived keys.
- Never bake keys into images or templates, or store them in a non-CVM pod (Pod security).