Skip to main content

Developer Quickstart

Get started in 5 min​

This guide takes you from zero to your first authenticated API call against the Lium platform API.

Step 1 — Get an API key​

  1. Log in to lium.io.
  2. Navigate to Settings → API Keys.
  3. Click Create API Key, copy the key, and store it securely.

Step 2 — Make your first request​

List your pods:

export LIUM_API_KEY=your_api_key_here

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

Step 3 — Pick a node and a template​

Renting happens on a node, so list what is available and take an id. Prices are per GPU per hour, in price_per_gpu:

curl https://lium.io/api/executors \
-H "X-API-Key: $LIUM_API_KEY" \
| jq 'sort_by(.price_per_gpu) | .[0] | {id, machine_name, gpu_count, price_per_gpu}'

You also need a template, which decides the image the pod boots:

curl https://lium.io/api/templates \
-H "X-API-Key: $LIUM_API_KEY" \
| jq '.[] | select(.name | contains("Pytorch")) | {id, name}'

Step 4 — Rent the node​

curl -X POST https://lium.io/api/executors/<executor_uuid>/rent \
-H "X-API-Key: $LIUM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pod_name": "my-first-pod",
"user_public_key": "'"$(cat ~/.ssh/id_ed25519.pub 2>/dev/null || cat ~/.ssh/id_rsa.pub)"'",
"template_id": "<template_uuid>",
"termination_hours": 1
}'

The key you send is the one you will connect with, so send a public key you hold the private half of. pod_name and user_public_key are required, and you must pass exactly one of template_id or dockerfile_content. termination_hours is your safety net: the pod terminates itself after that many hours even if nothing else does.

The response is {"success": true, "pod_id": "<uuid>"}.

Step 5 — Wait for it, then connect​

curl https://lium.io/api/pods/<pod_id> \
-H "X-API-Key: $LIUM_API_KEY" \
| jq '{status, ssh_connect_cmd}'

Poll until status is RUNNING. At that point ssh_connect_cmd carries the command to reach the pod.

Step 6 — Terminate it​

Billing runs until you do this:

curl -X DELETE https://lium.io/api/pods/<pod_id> \
-H "X-API-Key: $LIUM_API_KEY"

End state: You have rented, used and released a pod entirely over the API. The live OpenAPI reference is at lium.io/documents.

Next — the CLI​

Install the CLI for scripted workflows:

curl -fsSL https://lium.io/install.sh | bash   # or `pip install lium.io`
lium --help

See the CLI installation guide for platform notes, version pinning, and the Python package alternative.

Next steps​