LOLM is an HTTP + SSE agent API with an npm client and a CLI. Use the hosted base URL or point at your own self-hosted instance — same routes, same receipts.
lolm-nfet-client — zero deps, works with fetch.
lolm-cli — exit non-zero unless code ran.
curl, Python, Go, Ruby… POST JSON, read SSE events.
Same API shape. Unlimited when not on the shared box.
GET /api/demo/integrate
· openapi.json
· Live usage: /api/demo/billing/usage
npm install lolm-nfet-client
import { runCode, buildVisual, getStatus } from "lolm-nfet-client";
// optional: process.env.LOLM_BASE_URL || default public host
const baseUrl = "https://lolm.imagineqira.com";
console.log(await getStatus({ baseUrl }));
const done = await runCode({
baseUrl,
task: "write fizzbuzz to 20 in solution.py and run it",
onEvent: (ev) => console.log(ev.event),
});
console.log(done?.receipt_sha || done?.receipt?.receipt_sha);
const vis = await buildVisual({ baseUrl, task: "a tiny counter app" });
// vis.html → render in iframe sandbox
npm install -g lolm-cli lolm status lolm code "write fizzbuzz to 20 in solution.py and run it" --save ./out lolm build "a snake game" -o snake.html # your own instance lolm code "…" --base http://127.0.0.1:7866
# health
curl -sS https://lolm.imagineqira.com/api/demo/code/health | jq .
# usage remaining (no auth on free)
curl -sS https://lolm.imagineqira.com/api/demo/billing/usage | jq .
# coding agent (SSE stream)
curl -sSN -X POST https://lolm.imagineqira.com/api/demo/code/run \
-H 'Content-Type: application/json' \
-d '{"task":"print hello from main.py and run it"}'
# paid tier (after Stripe claim)
curl -sS https://lolm.imagineqira.com/api/demo/billing/usage \
-H "X-LOLM-License: $LOLM_LICENSE"
import json, urllib.request
BASE = "https://lolm.imagineqira.com"
def get(path):
with urllib.request.urlopen(BASE + path) as r:
return json.loads(r.read().decode())
print(get("/api/demo/integrate")["endpoints"][:3])
print(get("/api/demo/billing/usage")["runs"])
# Streaming code run: use requests + iter_lines, or httpx,
# and parse SSE blocks (event: / data:). See JS parseSSEStream for the shape.
Nginx only exposes /api/demo/* on the public host. That is the stable integration surface.
| Method | Path | Use for |
|---|---|---|
| GET | /api/demo/status | Ready? |
| GET | /api/demo/billing/usage | Quota left |
| GET | /api/demo/integrate | This catalog (JSON) |
| POST | /api/demo/run/stream | Chat agent SSE |
| POST | /api/demo/code/run | Coding jail loop SSE |
| POST | /api/demo/code/visual | HTML/app build |
| GET | /api/demo/code/receipts | Audit ledger |
| GET | /api/demo/code/task_state | Resume z_t by conversation_id |
Your server calls runCode with a license header for Plus/Pro. Map your user id → conversation_id for task state continuity.
lolm code "$TASK" --save ./out --json — non-zero exit if code didn’t run. Gate PRs on receipts.
Stream SSE to show write→run→fix live. Seal ends with code_receipt for your audit log.
Deploy the demo server; set baseUrl / --base / LOLM_BASE_URL. Unlimited local quotas.
X-LOLM-License on every request.X-Workspace-Owner: your-user-id.tiers, topups, and buy_topup. Offer plan upgrade (POST /api/demo/billing/checkout) or a one-time pack (POST /api/demo/billing/topup/checkout). Credits land via Stripe webhook + claim.event: agent_note
data: {"text":"task state z_t opened…"}
event: command_started
data: {"cmd":"python3 solution.py"}
event: code_done
data: {"ok":true,"files":["solution.py"],…}
event: code_receipt
data: {"receipt_sha":"…","ok":true,"task":"…"}
# same client code — only base changes
const baseUrl = process.env.LOLM_BASE_URL || "http://127.0.0.1:7866";
await runCode({ baseUrl, task: "…" });
See install → self-host. CORS is open on the workspace app for browser demos; production backends should call from your server.
Stable identity for integrators (better than IP free tier). Store the secret once — it is not shown again. This is not provider BYOK — those live on self-host under the Keys panel / /api/demo/keys.
curl -sS -X POST https://lolm.imagineqira.com/api/demo/api-keys \
-H 'Content-Type: application/json' \
-d '{"tier":"free","label":"my-app"}'
# use it
curl -sS https://lolm.imagineqira.com/api/demo/billing/usage \
-H "X-LOLM-Api-Key: lolm_…"
# paid tiers: send X-LOLM-License from Stripe claim, then mint tier=plus|pro
Self-host or loopback: paste Anthropic / OpenAI / Groq / Gemini / DeepSeek / Mistral / xAI / Fireworks / OpenRouter / Together / any OpenAI-compatible base URL. Keys apply instantly to chat, code, and visual builds. Your keys are preferred over the shared gateway.
# on your box (localhost)
curl -sS -X POST http://127.0.0.1:7866/api/demo/keys \
-H 'Content-Type: application/json' \
-d '{"keys":{"OPENAI_API_KEY":"sk-…","OPENAI_MODEL":"gpt-4o-mini"}}'
# prove it works
curl -sS -X POST http://127.0.0.1:7866/api/demo/keys/probe \
-H 'Content-Type: application/json' \
-d '{"provider":"openai"}'
Optional webhook_url on code runs — public HTTPS only (SSRF-guarded). Fired when the run completes with receipt summary.
curl -sSN -X POST https://lolm.imagineqira.com/api/demo/code/run \
-H 'Content-Type: application/json' \
-H "X-LOLM-Api-Key: $LOLM_API_KEY" \
-d '{"task":"print 1 and run it","webhook_url":"https://your.app/hooks/lolm"}'
from lolm_client import LOLM
c = LOLM(api_key="lolm_…") # or LOLM() free IP
print(c.usage())
r = c.run_code_collect("write fizzbuzz to 20 in solution.py and run it")
print(r["done"], r["receipt"])
Module path: clients/python/lolm_client.py in the repo (PYTHONPATH=clients/python).