API Reference
Base URL: https://loremind.peekgames.dev/api/loremind/v1
Last verified against LoreMind v1.0.67 (August 2026).
Authentication
LoreMind uses API keys for server-to-server authentication. Keys are created in Projects under your project’s API Keys section, and each key is scoped to a single project.
| Key Type | Prefix | Use Case |
|---|---|---|
| Server Key | sk_server_ | Production server integration (NPC interactions) |
| Editor Key | sk_editor_ | Game engine editor tooling (lore data, scanner, project settings) |
Include your API key in the Authorization header:
Authorization: Bearer sk_server_your_key_hereRequests authenticated with an API key are automatically scoped to the key’s project — no projectId parameter is needed. JWT tokens are not accepted.
Stability Tiers
The runtime NPC endpoint (POST /npc/interact, Server Key) is the stable integration surface for your game. Editor-key endpoints are tooling APIs: they power the engine SDKs’ editor features and may change between SDK releases without notice.
Endpoints
NPC Interaction
Stable runtime surface — Server Key (sk_server_*). Full details: NPC Interaction.
| Endpoint | Description |
|---|---|
| POST /npc/interact | Generate an NPC response to player input |
Lore Data
Tooling API — Editor Key (sk_editor_*). Full details: Lore Data.
| Endpoint | Description |
|---|---|
| GET /lore/minds | List Entity Minds |
| GET /lore/tags | List tags |
| GET /lore/locations | List locations |
| GET /lore/relationships | List NPC-to-NPC relationships |
| GET /lore/relationship-types | List custom relationship types |
| GET /lore/documents | List Lore Documents (metadata) |
| GET /lore/documents/{documentId} | Get one document with content |
| GET /lore/documents/export | Bulk-export documents (powers Lore Sync) |
| GET /lore/project-settings | Project-level NPC configuration |
Lore Scanner
Tooling API — Editor Key (sk_editor_*). Full details: Lore Scanner.
| Endpoint | Description |
|---|---|
| POST /scanner/estimate | Estimate scan cost from file metadata |
| POST /scanner/submit-archive | Create a scan job, get a signed upload URL |
| POST /scanner/submit-archive/confirm | Confirm upload, reserve credits, queue job |
| GET /scanner/jobs | List scan jobs |
| GET /scanner/jobs/{jobId} | Poll job status and results |
| DELETE /scanner/jobs/{jobId} | Cancel an unconfirmed job |
| POST /scanner/commit | Create Lore Documents from approved extractions |
| POST /scanner/rescan | Diff file hashes against previous scans (true-up) |
Rate Limits
NPC interactions (POST /npc/interact) are rate limited per minute, both per player (using playerId) and per project — defaults are 60 requests/minute per player and 200 requests/minute per project, configurable in Dashboard → Rate Limits. Full details, including 429 response headers, are in Errors & Rate Limits.
Credits
API usage consumes credits from your team balance: your subscription plan’s monthly credit allotment is used first, then top-up credits (which never expire). See Billing for how costs work, and manage your plan in the dashboard .
When the balance runs out, requests fail with 402:
{
"error": "Insufficient credits"
}Handle this gracefully in your game and top up (or enable auto-reload) in the dashboard.
SDK Integration
Game engine SDKs handle API calls automatically during editor testing. For production, you call the API from your backend - see Server Integration and the Unity SDK docs.