REST API + MCPBuild on the GEO engine

Build on the Lokrix AI GEO engine

A scoped REST API and an MCP server with 200+ tools expose the whole measurement engine — projects, scans, calibrated scores with confidence intervals, competitors, and the simulated optimization engine — to your code and your agents.

01Quick start

Your first call in three steps.

  1. 1. Mint a scoped key in Settings → API keys (least privilege — e.g. projects:read).
  2. 2. Set the base URL https://api.lokrix.de and the /v1 prefix.
  3. 3. Send a bearer-authenticated request:
curl
curl -H "Authorization: Bearer $LOKRIX_API_KEY" \
  https://api.lokrix.de/v1/projects

02Authentication & scopes

Bearer API keys with least-privilege scopes.

Every request authenticates with an API-key bearer token. Keys carry a set of scopes; a route accepts either the coarse legacy scope, a matching fine-grained scope, or the admin superscope. The API is read-only on Starter; Growth and Enterprise unlock the full read/write API and MCP plus BYOK.

projects:read / projects:write
Read or manage projects (the property resource).
scans:read / scans:write
Read scan results; start, cancel, and analyze scans.
scores:read / results:read
Read calibrated scores and engine results.
recommendations:read / :write
Read or generate simulated recommendations.
competitors:read / :write
Read or manage the competitor set + comparisons.
analytics:read
History, movers, anomalies, share-of-voice.
reports:read / reports:write
Read or generate scorecards + exports.
alerts:read / alerts:write
Read or manage regression/anomaly alerts.
billing:read / usage:read
Read credit balance, usage metering, invoices.
keys:read / keys:write
Mint and rotate scoped API keys.
webhooks:read / webhooks:write
Register and manage webhooks.
admin
Superscope — satisfies every other scope. Mint sparingly.

03Base URL & conventions

One base URL. Predictable envelopes.

Base URL
https://api.lokrix.de with a /v1 version prefix on every route.
Pagination
Offset pagination via limit + offset; responses return { items, total, limit, offset }.
Compression
Send accept-encoding: gzip, br — payloads are compressed over the wire.
Provenance & CI
Every scored payload carries a provenance badge (live / cached / predicted) and a 95% confidence interval.
Approval gate
Gated workspaces receive a 202 pending_approval envelope until an admin approves the action.
Rate & budget
Over-limit requests return 429; over-budget live runs are rejected against the tenant credit balance.

04Endpoint groups

The REST surface, grouped by resource.

Method · path · purpose · required scope. Every path is mounted under a real v1/ controller; project-scoped resources take a :projectId so a call always targets a single property.

Projects

The top-level property resource. Each project scopes its own prompts, scans, and scores.

GET
/v1/projects
List projects in the workspace
projects:read
POST
/v1/projects
Create a project (returns its id)
projects:write
GET
/v1/projects/:id
Fetch one project
projects:read
PATCH
/v1/projects/:id
Update project defaults
projects:write
DELETE
/v1/projects/:id
Delete a project
projects:write

Scans & analyze

Kick off measurement. A scan is optionally bound to a project via projectId; config sets engines, maxPrompts, samplesK.

POST
/v1/analyze
One-shot URL analysis (grade)
scans:write
POST
/v1/scans
Start a scan (optional projectId + config)
scans:write
GET
/v1/scans/:id
Poll scan status + result
scans:read
POST
/v1/scans/:id/cancel
Cancel a running scan
scans:write
GET
/v1/projects/:projectId/scans
List a project’s scans
scans:read
GET
/v1/scans/:scanId/engine-runs
Per-engine run detail
scans:read

Scores & engines

Calibrated presence probabilities with CIs, plus per-engine breakdowns and citation provenance.

GET
/v1/projects/:projectId/scores
Latest + historical scores (CI + provenance)
scores:read
GET
/v1/engines
Engine breakdown / matrix / health
results:read

Prompts

The prompt universe — generate, activate, lock, and manage per-project prompt sets and templates.

GET
/v1/projects/:projectId/prompt-sets
List prompt sets
projects:read
POST
/v1/projects/:projectId/prompt-sets
Generate / activate a prompt set
scans:write
GET
/v1/prompt-templates
Shared prompt templates
projects:read

Recommendations & optimize

Prioritized, simulated moves with predicted uplift. Predictive what-if runs cost 0 credits.

POST
/v1/projects/:projectId/recommendations
Generate recommendations
recommendations:write
GET
/v1/projects/:projectId/recommendations
List recommendations
recommendations:read

Competitors & analytics

Share-of-voice, head-to-head comparison, movers, new entrants, anomalies, and history.

GET
/v1/projects/:projectId/competitors
Competitor set + compare
competitors:read
GET
/v1/analytics
History, movers, anomalies
analytics:read

Goals, scorecards & segments

Targets, executive scorecards, and prompt/engine segmentation, all scoped to a project.

GET
/v1/projects/:projectId/goals
Visibility goals
projects:read
GET
/v1/projects/:projectId/scorecards
Scorecards
reports:read
GET
/v1/projects/:projectId/segments
Segments
analytics:read

Alerts & notifications

Regression alerts, anomaly detection, digests, and notification channels/routes.

GET
/v1/projects/:projectId/alerts
Alert rules
alerts:read
POST
/v1/projects/:projectId/notification-channels
Configure channels
alerts:write
GET
/v1/notification-preferences
Account notification prefs
account:read

Billing & usage

Credit balance, usage metering, invoices, and Stripe-backed billing.

GET
/v1/usage
Credit usage + metering
usage:read
GET
/v1/billing
Plan + invoices
billing:read
GET
/v1/quota
Remaining quota
usage:read

Keys, webhooks & audit

Mint scoped API keys, register webhooks, and read the tamper-evident audit log.

GET
/v1/api-keys
List / mint API keys
keys:read
GET
/v1/webhooks
List / register webhooks
webhooks:read
GET
/v1/audit
Audit log
admin

Workspace & members

Organizations, workspaces, members, roles, branding, saved views, and privacy controls.

GET
/v1/workspaces
Workspaces
workspaces:read
GET
/v1/members
Members + roles
projects:read
GET
/v1/saved-views
Saved dashboard views
projects:read

Grouped from the real @Controller('v1/…') set. See the OpenAPI spec below for the complete, authoritative operation list.

05OpenAPI & the TypeScript SDK

Typed spec. Generate a client in any language.

The API is NestJS + @nestjs/swagger. The raw OpenAPI 3.1 document is served at /openapi.json (alias /v1/openapi.json) with Swagger UI at /docs when docs are published. Point any generator at the JSON, or use the maintained @lokrix/sdk — the TypeScript client generated from that spec.

typescript · @lokrix/sdk (generated from the OpenAPI spec)
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; confirm the exact export surface against the published @lokrix/sdk version. Python and Go SDKs are on the roadmap.

06MCP server

200+ tools for agents — over stdio or Streamable HTTP.

@lokrix/mcp-server ships the lokrix-mcp CLI with two transports: stdio (default — run as a subprocess) and Streamable HTTP (--http or MCP_HTTP_PORT, path /mcp). Both read LOKRIX_API_URL and LOKRIX_API_KEY from the environment. Every tool declares a scope, readOnly, destructive, and provenance.

Connect an agent (Claude Desktop / any MCP client) — stdio

json · mcp client config
{
  "mcpServers": {
    "lokrix": {
      "command": "npx",
      "args": ["-y", "@lokrix/mcp-server"],
      "env": {
        "LOKRIX_API_KEY": "sk_live_...",
        "LOKRIX_API_URL": "https://api.lokrix.de"
      }
    }
  }
}

Streamable HTTP — for shared / remote agents

shell
MCP_HTTP_PORT=3001 \
  npx @lokrix/mcp-server --http
# → POST MCP requests to http://host:3001/mcp

Example flow: lokrix.list_projects lokrix.start_scan({ url, projectId }) → poll lokrix.get_scan / lokrix.get_visibility. Predictive tools (lokrix.simulate_change, lokrix.get_optimization_plan) cost 0 credits.

Projects
lokrix.list_projects · lokrix.create_project · lokrix.get_project · lokrix.update_project · lokrix.delete_project
Scans & engine-runs
lokrix.analyze_url · lokrix.start_scan · lokrix.get_scan · lokrix.list_scans · lokrix.cancel_scan · lokrix.estimate_scan_cost · lokrix.get_scan_advice
Scores & analytics
lokrix.score_prompt · lokrix.get_visibility · lokrix.get_history · lokrix.get_engine_breakdown · lokrix.get_analytics_overview
Prompts
lokrix.get_prompt_set · lokrix.generate_prompts · lokrix.activate_prompt_set · lokrix.lock_prompt_set · lokrix.add_prompt · lokrix.add_prompts_bulk
Recommendations & optimize
lokrix.list_recommendations · lokrix.generate_recommendations · lokrix.get_recommendations_summary · lokrix.get_optimization_plan · lokrix.simulate_change
Competitors
lokrix.list_competitors · lokrix.compare_competitors · lokrix.compare_head_to_head · lokrix.get_competitor_trends
Reports
lokrix.create_report · lokrix.list_reports · lokrix.get_report · lokrix.share_report
Goals · alerts · schedules
lokrix.list_goals · lokrix.create_goal · lokrix.list_alerts · lokrix.create_alert · lokrix.get_schedule · lokrix.set_schedule
Integrations · billing · usage
lokrix.list_integrations · lokrix.get_usage · lokrix.get_subscription · lokrix.get_credit_balance · lokrix.list_api_keys · lokrix.list_webhooks

Credits, rate limits & provenance

1 credit = 1 live engine response. Predictive = 0 credits.

Only live answer-engine runs meter credits — cost scales as prompts × engines × samples × cadence. Predictive scoring and what-if simulation run on the calibrated model and are free on every plan. Every scored payload badges its provenance (live / cached / predicted) and carries a 95% confidence interval; over-limit requests return 429, and over-budget live runs are rejected against the tenant’s credit balance.

07Developer FAQ

Common questions.

Is the API read-only on some plans?
On Starter, the REST API and MCP server are read-only. Growth and Enterprise unlock the full read/write API and MCP, plus BYOK (bring-your-own encrypted provider keys). The Free plan has no API/MCP access.
How do API-key scopes map to permissions?
Keys carry scopes from ApiKeyScopeSchema. Coarse legacy scopes (projects:read, scans:write, recommendations:read, usage:read) and fine-grained scopes (scores:read, results:read, analytics:read, alerts:read, alerts:write, webhooks:read, webhooks:write, …) both work: a route accepts either the coarse scope OR a matching fine-grained scope OR the admin superscope. Mint least-privilege keys per integration.
What is the difference between the stdio and HTTP MCP transports?
stdio (the default) runs lokrix-mcp as a subprocess of an MCP client such as Claude Desktop — best for a single local agent. Streamable HTTP (--http or MCP_HTTP_PORT) exposes the same tools over HTTP at /mcp — best for shared or remote agents. Both read LOKRIX_API_URL and LOKRIX_API_KEY from the environment.
Which tools and endpoints spend credits?
A credit is one live answer-engine response. Only live engine runs (start_scan / analyze against real engines) meter credits — prompts × engines × samples × cadence. Predictive scoring, what-if simulation (simulate_change), and path-to-#1 previews (get_optimization_plan) run on the calibrated model and cost 0 credits on every plan.
How do I read the OpenAPI spec and generate a client?
The API is NestJS + @nestjs/swagger. When docs are published, the raw OpenAPI 3.1 JSON is served at /openapi.json (with a /v1/openapi.json alias) and Swagger UI at /docs. Point any OpenAPI generator at the JSON to produce a typed client in your language, or use the maintained @lokrix/sdk (TypeScript).
What does every scored response carry?
Provenance (live / cached / predicted) and a 95% confidence interval on every probability. Responses are paginated with offset/limit ({ items, total, limit, offset }) and gzip/br compressed. Gated workspaces receive a 202 pending_approval envelope; over-budget requests return 429.

Ship your first Lokrix AI integration.

Mint a scoped key, point the SDK or MCP server at https://api.lokrix.de, and read calibrated AI-visibility scores from your code or your agents.