Developer overview
The whole Lokrix measurement engine is programmable. A scoped REST API, a generated TypeScript SDK, and an MCP server expose the same resources you drive in the app — projects, scans, calibrated scores with confidence intervals, competitors, and the simulated optimization engine — to your code and your agents.
Three ways to build
All three surfaces talk to the same API and honour the same tenancy, scopes, and credit accounting. Pick the one that fits your integration:
- REST API — bearer-authenticated HTTP under a
/v1version prefix, described by an OpenAPI 3.1 document. Use it from any language. - MCP server —
@lokrix/mcp-serverexposes the engine as tools for agents (Claude Desktop and any MCP client) over stdio or Streamable HTTP. - SDK —
@lokrix/sdk, a typed TypeScript client generated from the OpenAPI spec, so you never hand-write request plumbing.
Authentication & access
Every request authenticates with an API-key bearer token that carries a set of least-privilege scopes. Mint keys in Settings → API keys. Access is tiered: the Free plan has no API/MCP access, Starter is read-only, and Growth and Enterprise unlock the full read/write API and MCP (plus bring-your-own encrypted provider keys). The full endpoint and tool tables live on the public developer reference.
What every response carries
The API is data-honest by construction. Scored payloads never return a single-run yes/no — they carry:
- Provenance — a badge of
live,cached, orpredicted. Mock/sample data is never presented as live. - A 95% confidence interval on every probability, because engine answers are non-deterministic and sampled Monte-Carlo style.
- Predictable envelopes — offset pagination (
{ items, total, limit, offset }), gzip/br compression, a202 pending_approvalenvelope for gated workspaces, and429for over-limit or over-budget requests.
Credits are the same as in the app
One credit is one live answer-engine response, so live-run cost scales as prompts × engines × samples × cadence. Predictive scoring and what-if simulation run on the calibrated model and cost 0 credits on every plan. See Credits & metering for how the balance is charged, whichever surface you call from.