AI Agents
This page is the entry point for AI agents (Claude, ChatGPT, Cursor, in-house copilots, …) integrating with Lium. Everything else in the Developers section also applies to agents — this page just stitches the pieces together.
Prefer to work from a single file? lium.io/llms-full.txt is the whole agent reference in one fetch — install, signup, the agent skill, and every CLI and SDK command — enough to go from no account to a rented GPU without reading anything else.
Get started in 5 min
The CLI is the preferred surface for an agent: it covers signup, funding, renting and SSH, so there is no web form to fill and no HTTP to hand-roll. Drop to the REST API only where the CLI cannot go — no shell in your sandbox, or an endpoint it does not wrap.
- Install the CLI and get an account:
curl -fsSL https://lium.io/install.sh | bash
lium signup --email you@example.com # no account yet
lium init --no-browser # account exists — prints an approval URL - Rent a GPU and connect:
lium ls --format json # browse machines
lium up <node-id> --yes # rent
lium ssh <pod> # connect - Ground yourself in the docs — add the MCP server for targeted search:
Or pull the whole corpus in one fetch:
{
"mcpServers": {
"lium-docs": { "url": "https://docs.lium.io/mcp" }
}
}curl -sSL https://docs.lium.io/llms-full.txt. - Call the REST API for anything the CLI does not cover:
curl -sSL https://lium.io/api/openapi.json
Pick the right surface
| Goal | Use this | Why |
|---|---|---|
| Answer questions about Lium docs | MCP endpoint — https://docs.lium.io/mcp | Targeted search + page reads, no token bloat |
| Ground a long conversation in the full docs | llms.txt / llms-full.txt | One fetch, every page concatenated |
| Read a single page as raw markdown | Append .md to any URL — e.g. /providers/quickstart.md | No HTML to parse |
| Call an endpoint the CLI does not wrap | OpenAPI spec — https://lium.io/api/openapi.json | Source of truth for every REST endpoint |
| Drive pods from a shell agent | CLI | Stable subcommands, JSON output, no auth headers to manage |
| Take a user from no account to an API key | lium signup | Creates the account and mints its key from the terminal — no web form |
| Teach your agent Lium's commands once | Agent skill — npx skills add Datura-ai/lium-skill --skill lium | Ships with the agent, so no doc fetch mid-task |
| Automate the provider portal (Subnet 51) | lium provider | Same surface as lium.io/portal: node lifecycle, central-miner-server config, sync, billing, machine requests — all --json-able |
| Write code against typed Python clients | SDK | lium.machine decorator + Lium() client |
Stable agent-facing URLs
These URLs are stable and safe to hard-code in agent configurations:
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
Start from no account
An agent creates the account itself — no web form. lium signup creates it and stores the API key it mints. New accounts usually get a $5 credit, enough to rent straight away, but it is granted once per signup IP — read signup_credit_granted from the --json output rather than assuming it landed.
lium signup --email you@example.com --json
Ask for the user's real email: the confirmation link goes there, and clicking it is the one step an agent cannot do for them — renting fails with 403 User is not verified until they do.
Authentication
The platform API authenticates with an API key, sent in the X-API-Key header on every request; the CLI stores the key and sends it for you. The docs surfaces (MCP, llms.txt, .md URLs) require no auth.
lium signup mints and stores the key for a new account. For an account that already exists, lium init --no-browser prints an approval URL and a session ID; once the user has approved it, lium init --session <ID> saves the key. Plain lium init opens a browser and is not usable by an agent. A key copied from Settings → API Keys at lium.io works too.
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)
An agent with its own crypto wallet can keep itself funded without a human. Use lium topup: create a stablecoin invoice, read the deposit address, send the funds from your wallet, then poll the balance. Every subcommand supports --json.
# 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.
# Lium never moves your funds — only you can sign this transfer.
# 3. Poll until the credit lands
lium balance --json
Lium issues the invoice and credits the balance once the payment is confirmed on-chain; the transfer itself stays in your wallet. See lium topup for currency discovery and the full invoice response.
Recommended agent loop
- Install the CLI and authenticate —
lium signupfor a new account,lium init --no-browserfor an existing one. - Drive the platform with
liumcommands, reading results as JSON. - Drop to the REST API only where the CLI has no equivalent: resolve the endpoint from the OpenAPI spec and send
X-API-Key. - Pull context from MCP
search— or feedllms-full.txtonce — when you need to explain or troubleshoot rather than act.
Related
- MCP endpoint — JSON-RPC contract and tool definitions
- llms.txt — llmstxt.org-format docs bundle
- OpenAPI spec — code-gen and tool-use examples
- CLI overview — full command surface
- SDK — typed Python client