SDK

@lokrix/sdk is the maintained TypeScript client for the Lokrix AI GEO engine. It is generated from the same OpenAPI 3.1 document that describes the REST API, so its types and the API never drift.

Install & authenticate

The client takes an API-key bearer token — mint a least-privilege scoped key in Settings → API keys and read it from the environment, never hard-code it.

import { LokrixClient } from "@lokrix/sdk";

const lokrix = new LokrixClient({ apiKey: process.env.LOKRIX_API_KEY });

const { items } = await lokrix.projects.list();
const scan = await lokrix.scans.create({
  url: "https://acme.com",
  projectId: items[0].id,
});

Illustrative — the SDK is generated from the OpenAPI spec, so confirm the exact export surface against the published @lokrix/sdk version.

Typed end to end

Because it is generated from the spec, the SDK mirrors the API’s conventions: offset pagination ({ items, total, limit, offset }), and scored results that carry provenance (live / cached / predicted) and a 95% confidence interval. See Data honesty for why a probability is never a single-run yes/no.

Other languages

TypeScript is the maintained client today. For any other language, point an OpenAPI generator at /openapi.json (alias /v1/openapi.json) to produce a typed client now. Python and Go SDKs are on the roadmap.

Credits behave identically

The SDK is a thin, typed wrapper over the REST API — it spends credits under the exact same rules. Only live engine runs meter credits; predictive scoring and what-if simulation are free. See Credits & metering and the full developer reference.