lelu

Installation

Install the SDK, get an API key, and start authorizing agent actions — no Docker, no server setup.


1

Install the SDK

Add lelu-agent-auth to your project:

npm install lelu-agent-auth

Supports Node.js 18+. TypeScript types are included — no separate @types package needed.

2

Get an API key

Visit lelu-ai.com/api-key and click Generate Key. No signup, no email — instant anonymous key with 500 requests/day free.

Add it to your .env file:

.env
LELU_API_KEY=your_key_here

Never commit your API key to version control. Add .env to .gitignore.

3

Configure the client

Create a shared client instance and import it wherever you need to authorize actions:

lib/lelu.ts
import { createClient } from "lelu-agent-auth";

export const lelu = createClient({
  apiKey: process.env.LELU_API_KEY,
});

That's all the configuration needed. The SDK routes to the live cloud engine automatically when an API key is present.

Then use it anywhere in your app:

TypeScript
import { lelu } from "@/lib/lelu";

const decision = await lelu.agentAuthorize({
  actor: "billing-agent",
  action: "refund:process",
  resource: { orderId: "ord_123" },
  context: { confidence: 0.85 },
});

if (decision.allowed) {
  // proceed
} else if (decision.requiresHumanReview) {
  // queued for human approval
} else {
  throw new Error(`Denied: ${decision.reason}`);
}
4

Done

Your agent is connected to the Lelu cloud engine. No Docker, no local server, no infrastructure to manage.

Where to go next:

Self-hosting (advanced)

If you need to run the engine on your own infrastructure, pass a baseUrl to the client or set the LELU_BASE_URL environment variable:

TypeScript
const lelu = createClient({
  baseUrl: "https://your-engine.example.com",
  apiKey: process.env.LELU_API_KEY,
});

Or without any code change:

.env
LELU_BASE_URL=https://your-engine.example.com
LELU_API_KEY=your_key_here

To run the engine locally with Docker:

terminal
git clone https://github.com/lelu-auth/lelu.git
cd lelu
docker-compose up -d

See the production self-hosting guide for Docker Compose and Kubernetes manifests.

How URL resolution works

The SDK picks the engine URL automatically:

SituationEngine used
apiKey provided, no baseUrlLelu cloud (GCP)
LELU_BASE_URL env var setThat URL
baseUrl passed to createClientThat URL
No apiKey, no env var, no baseUrlhttp://localhost:8080 (self-hosted dev)