Errors & Rate Limits
Every common LoreMind API error, what causes it, and how to handle it, plus the rate-limit defaults.
Errors return a JSON body with an error message. Some include extra fields: retryAfter on 429 and 503 Lore unavailable, currentStatus on scanner 409 responses, code and message on 403 Terms of Service not accepted and on the signed player errors, and code, message and unknownTags on 400 Unknown knowledge tags.
Common Errors
| Status | Error | Returned by | What to do |
|---|---|---|---|
| 400 | endpoint-specific validation messages | all endpoints | Fix the request. Each endpoint's error table lists its exact 400 messages (NPC Interaction, Lore Scanner) |
| 400 | Unknown knowledge tags (code UNKNOWN_KNOWLEDGE_TAGS) | POST /npc/interact | None of the request's activeKnowledgeTags exist on the Entity Mind. No reply was generated and nothing was charged. See Unknown Knowledge Tags below |
| 401 | Invalid API key | POST /npc/interact | The key is missing, malformed, or revoked. Check the full sk_server_* key |
| 401 | Invalid authentication | editor-key endpoints | Missing or invalid Editor Key (sk_editor_*) |
| 402 | Insufficient credits | credit-consuming requests (/npc/interact, scanner submit/confirm) | Top up or enable auto-reload. See Insufficient Credits below |
| 403 | Invalid authentication | POST /npc/interact | An Editor Key was used where a Server Key is required |
| 403 | Access denied | scanner job endpoints | The job belongs to a different project |
| 403 | Terms of Service not accepted (code TERMS_NOT_ACCEPTED) | all API-key endpoints | Nobody who runs the team has accepted updated Terms. See Terms Not Accepted below |
| 403 | Player assertion required (code PLAYER_ASSERTION_REQUIRED) | POST /npc/interact | Your project requires signed players and a memory request came without playerAssertion. Not charged. See Signed Players |
| 403 | Invalid player assertion (code PLAYER_ASSERTION_INVALID) | POST /npc/interact | The playerAssertion is malformed, expired, valid for more than 1 hour, wrongly signed, or for another player. Not charged. See Signed Players |
| 404 | Project not found | POST /npc/interact | Invalid project or key |
| 404 | Entity Mind not found | POST /npc/interact | Check entityMindId against the dashboard |
| 404 | Job not found | scanner job endpoints | Invalid jobId |
| 409 | Job is not awaiting upload | scanner confirm/cancel | Job already confirmed, expired, or cancelled. The response includes currentStatus |
| 429 | Rate limit exceeded | POST /npc/interact | Wait and retry. See Rate Limits below |
| 503 | Lore unavailable | POST /npc/interact | The NPC's lore couldn't be searched, so no reply was made and nothing was charged. Retry after the Retry-After header's seconds. See Lore Unavailable below |
| 503 | Generation failed | POST /npc/interact | The language model failed to reply. Nothing was charged. No Retry-After header: show the player an error and let them try again |
Insufficient Credits (402)
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). 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. See Credits & Billing for how costs work.
Unknown Knowledge Tags (400)
activeKnowledgeTags narrows which of the Entity Mind's tags a request searches. If none of the requested tags exist on the Entity Mind, there is no lore to answer from, and an NPC never replies without its lore. POST /npc/interact fails with 400 instead, and the request isn't charged:
{
"error": "Unknown knowledge tags",
"code": "UNKNOWN_KNOWLEDGE_TAGS",
"message": "None of the requested activeKnowledgeTags exist on this Entity Mind: act-3, castle. No reply was generated.",
"unknownTags": ["act-3", "castle"]
}Don't retry it: the same tags fail the same way. Check the tags against the Entity Mind's tags in the dashboard (a renamed or removed tag is the usual cause), or leave activeKnowledgeTags out to use all of them. When only some tags are unknown, the request still works: it searches the valid ones, and metadata.warnings names the ones it ignored. See Active Knowledge Tags.
Terms Not Accepted (403)
When LoreMind's Terms of Service change, an owner or admin of each team must sign in to the dashboard and accept them. We email owners and admins before and after the change. If nobody has accepted:
- From the date the new Terms take effect, Editor Keys are refused. Server Keys keep working, so your game is not affected yet.
- 30 days later, Server Keys are refused too.
Refused requests return 403:
{
"error": "Terms of Service not accepted",
"code": "TERMS_NOT_ACCEPTED",
"message": "An owner or admin of this team must sign in to the LoreMind dashboard and accept the updated Terms of Service."
}Access returns as soon as an owner or admin accepts in the dashboard.
Lore Unavailable (503)
Every NPC reply uses your project's lore. If LoreMind can't search the lore for a request, it doesn't reply without it: POST /npc/interact fails with 503 instead, and the request isn't charged. The response carries a Retry-After header in seconds and the same value in the body:
{
"error": "Lore unavailable",
"message": "The NPC's lore could not be searched right now. Please try again.",
"retryAfter": 5
}Wait at least Retry-After seconds and send the request again, a limited number of times. This is the only failure to retry automatically: never retry a request that timed out, since LoreMind may have finished it. If you run a backend between your game and LoreMind, pass this response through unchanged (status, body and Retry-After header) rather than replacing it with canned NPC lines. Details are in the POST /npc/interact reference.
Slow First Requests
The first request after a period of inactivity can take much longer than usual, sometimes minutes. LoreMind allows up to 600 seconds per request, so a timeout shorter than that turns a slow first reply into an error. Set every timeout between your game and LoreMind to at least 600 seconds: see Timeouts.
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.
Both limits are configurable in Dashboard → Rate Limits.
Response Headers
When rate limited, the API returns 429 with:
Retry-Afterheader: seconds until retryretryAfterfield in the JSON body
SDK Error Codes (Unity)
When you use the Unity SDK, failures surface as codes on NPCResponse.error (constants in Peek.LoreMind.Cloud.LoreMindErrorCodes) rather than raw HTTP statuses. A failed response never carries dialogue. The same codes apply in the Editor and through your backend, as long as your backend passes LoreMind's status code and body through unchanged.
| SDK code | HTTP | Meaning |
|---|---|---|
CONFIG_ERROR | none | Not set up: no transport, no Entity Mind ID, or no backend URL (check the Control Panel) |
EMPTY_TEXT | none | RespondAsync was called with empty text |
BUSY | none | The NPC is still answering the previous request |
CANCELLED | none | The request was cancelled (NPC destroyed, Play mode ended, or your token) |
VALIDATION_ERROR | 400 | Request rejected as invalid, for example an empty knowledge tag (the SDK refuses some of these before sending) |
UNKNOWN_KNOWLEDGE_TAGS | 400 | None of the NPC's Active Knowledge Tags exist on the Entity Mind. No reply, no credits used |
AUTH_FAILED | 401 | Key or player token rejected, or your token provider returned no token |
INSUFFICIENT_CREDITS | 402 | Out of credits |
FORBIDDEN | 403 | Key not allowed for this call, for example an Editor Key used for NPC requests |
TERMS_NOT_ACCEPTED | 403 | An owner or admin must accept the updated Terms of Service |
ENTITY_MIND_NOT_FOUND | 404 | The Entity Mind ID doesn't exist in this project |
NOT_FOUND | 404 | Something else wasn't found, for example your backend's path |
RATE_LIMITED | 429 | Too many requests (wait retryAfter seconds) |
LORE_UNAVAILABLE | 503 | The NPC's lore couldn't be searched, even after the SDK's automatic retries. No credits used |
SERVICE_UNAVAILABLE | 503 | Generation failed. No credits used |
SERVER_ERROR | 5xx | Unexpected server error |
REQUEST_FAILED | none | No usable response from LoreMind: no connection, or no reply within 600 seconds |
CONNECTION_ERROR | none | The SDK couldn't reach your backend, or got no reply in time |
RESPONSE_TOO_LARGE | none | The response was larger than 1 MiB |
PARSE_ERROR | none | The response wasn't valid NPCResponse JSON |
TRANSPORT_ERROR | none | The transport threw an exception |
The SDK retries one failure on its own: a 503 that carries Retry-After (such as Lore unavailable). It waits exactly that delay and tries again, up to 3 attempts in all; a requested wait over 25 seconds isn't slept through and goes to your game with retryAfter set. Nothing else is retried.
Full details are in the SDK API Reference.
Next Steps
- POST /npc/interact - The stable endpoint's complete error table
- Lore Scanner API reference - Per-endpoint scanner errors
- Authentication - Key types and how to store them
- Credits & Billing - How usage is billed