Skip to main content

AI Agents

An agent can do everything on Lium with no browser: sign up, fund, rent, connect and remove pods. For script flags and exit codes see Scripting for agents.

Get started in 5 min​

Use the CLI. Use the REST API only where the CLI cannot go.

1. Install the CLI and get an account

curl -fsSL https://lium.io/install.sh | bash
export LIUM_API_KEY=sk_... # you already hold a key: nothing else to set up
lium signup --email you@example.com # no account yet
lium init --no-browser # account exists, no key; prints a URL a human approves

2. Rent a GPU and connect

lium ls --format json # browse machines; pass the `id` field to up
lium up <node-id> --yes --no-ssh --ttl 1h --name job-1 # rent, return when ready, self-remove in 1 h
lium exec <pod> "nvidia-smi" # run without a terminal (lium ssh is interactive)

3. Add the Lium MCP server: live GPU search, prices and docs

{
"mcpServers": {
"lium": { "url": "https://docs.lium.io/mcp" }
}
}

Or fetch all docs at once: curl -sSL https://docs.lium.io/llms-full.txt.

4. Use the REST API for the rest

curl -sSL https://lium.io/api/openapi.json

Pick the right surface​

GoalUse this
Search the docsMCP endpoint: https://docs.lium.io/mcp
Load all docs at oncellms.txt / llms-full.txt
Read one page as markdownAdd .md to any docs URL
Quote GPU prices with no accountPrice feed: https://lium.io/pricing.json
Facts about LiumAbout page
Call an endpoint the CLI does not wrapAPI: https://lium.io/api/openapi.json
Run pods from a shellCLI
Get an account with no humanFingerprint signup
Get an account and key from the terminallium signup
Teach your agent Lium's commandsAgent skill: npx skills add Datura-ai/lium-skill --skill lium
Automate the provider portallium provider
Write PythonSDK

Stable agent-facing URLs​

Safe to hard-code:

https://docs.lium.io/mcp # docs MCP JSON-RPC endpoint
https://docs.lium.io/llms.txt # docs index + summaries
https://docs.lium.io/llms-full.txt # all docs concatenated
https://docs.lium.io/<any-page>.md # raw markdown for any page
https://lium.io/api/openapi.json # live platform OpenAPI 3.1 spec
https://lium.io/documents # Swagger UI for the same spec
https://lium.io/llms.txt # platform agent index: CLI + skill install
https://lium.io/llms-full.txt # full CLI/SDK reference, self-contained
https://lium.io/pricing.json # per-model GPU prices, JSON, no key
https://lium.io/pricing # pricing hub; Accept: text/markdown for the markdown twin
https://lium.io/gpu/<slug> # one page per GPU model, same negotiation
https://lium.io/api/public/v1/nodes # per-node inventory feed, no key
https://lium.io/about # company facts with sources, HTML only, no key

A wrong URL on lium.io returns 404 with links to the sitemap, llms.txt, the docs and the API: in markdown for curl, in JSON with Accept: application/json.

Start from no account​

Fingerprint signup (no human)

curl -fsS -X POST https://lium.io/api/auth/signup \
-H "Content-Type: application/json" -d '{}'

Returns a login fingerprint and usually an API key. The fingerprint is shown once and cannot be reset: store it first. See Signing up without an email.

E-mail signup

lium signup --email you@example.com --json

Use the user's real e-mail. Confirming it is not needed to rent.

Credit

A new account starts with a zero balance. Top up to rent.

Signup to running pod

Renting needs a balance above 15 minutes of the node's hourly price (hourly_price / 4) plus 15 minutes of each open pod. Some older accounts need more.

lium signup --email you@example.com --json # or POST /api/auth/signup for no email at all
lium balance --json # must exceed 15 min of the node's hourly price
lium ls --format json # pick a node
lium up <node-id> --yes --no-ssh --ttl 15m # rent it, return when ready, auto-terminate after 15m
lium exec <pod> "nvidia-smi" # run something on it
lium rm <pod> --yes # hand it back (--yes: without it, no terminal = nothing removed)

Authentication​

Send the API key in the X-API-Key header. The CLI and SDK send it for you.

  • Have a key: export LIUM_API_KEY=sk_.... It wins over ~/.lium/config.ini.
  • New account: lium signup saves the key.
  • Existing account: lium init --no-browser prints a URL and a session ID. After the user approves, run lium init --session <ID>.
  • Check the key: lium balance --json. (lium ls works with any key.)

The docs surfaces (MCP, llms.txt, .md URLs) need no key. See API Authentication.

export LIUM_API_KEY=your_api_key_here
curl https://lium.io/api/pods -H "X-API-Key: $LIUM_API_KEY"

Self-funding (top up your own balance)​

With crypto

# 1. Create a $20 USDT (TRON) invoice; capture the address + exact amount
INVOICE=$(lium topup create -a 20 -c USDT -n tron --json)
ADDRESS=$(echo "$INVOICE" | jq -r .deposit_address)
AMOUNT=$(echo "$INVOICE" | jq -r .crypto_amount)

# 2. Send exactly $AMOUNT USDT on TRON to $ADDRESS from your own wallet.

# 3. Poll until the credit lands
lium balance --json

See lium topup.

With a saved card

Needs a card saved on the Billing page and an API key with the billing scope:

curl -X POST https://lium.io/api/payments/topup -H "X-API-Key: <your billing-scoped API key>" \
-H 'Content-Type: application/json' -d '{"amount_usd": 20, "idempotency_key": "run-42"}'

With a key that has a spending budget, only a card's first top-up asks for 3-D Secure; later top-ups charge it without asking. A key without a budget is also asked after several top-ups in a day. Lium asks again if it cannot confirm the card's earlier check, and the bank can always ask. When 3-D Secure is needed, the answer is 402 CARD_AUTHENTICATION_REQUIRED with a next_action_url. Give it to the cardholder. See Error codes.

With USDC on Base, in the request (x402)

Needs only a wallet holding USDC on Base and an API key (the signup key works). Being rolled out: until it is on, the call answers 403.

# 1. Ask: 402 with the payment requirements in the PAYMENT-REQUIRED header
curl -i -X POST "https://lium.io/api/x402/topup?amount_usd=20" -H "X-API-Key: $LIUM_API_KEY"

# 2. Repeat it with the signed payment; any x402 client (x402-fetch, x402-axios, x402 Python) does both steps
curl -X POST "https://lium.io/api/x402/topup?amount_usd=20" -H "X-API-Key: $LIUM_API_KEY" \
-H "PAYMENT-SIGNATURE: <base64 x402 payment>"
  • 200: credited. The PAYMENT-RESPONSE header has the transaction hash.
  • 202 processing: paid, not yet seen on chain. Repeat the same request.
  • Scheme exact (EIP-3009), x402 version 2, 1 USDC = $1, from the top-up minimum to $500.
  • The same signature never credits twice.
  1. Install the CLI and sign in.
  2. Run lium commands and read JSON output.
  3. Use the REST API only where the CLI has no command.
  4. Use MCP search or llms-full.txt to explain or troubleshoot.