Error envelope format
Error code reference
| Code | HTTP status | Description |
|---|---|---|
INVALID_API_KEY | 401 | Key missing or not recognised |
RATE_LIMIT_EXCEEDED | 429 | Per-minute limit hit — check Retry-After header |
OVER_LIMIT | — | Lifetime cap reached (in usage object, not HTTP error) |
AGENT_ALREADY_EXISTS | 409 | Name + owner pair already registered |
UPSTREAM_ERROR | 502 | Upstream search provider error |
SERVICE_UNAVAILABLE | 503 | Circuit breaker open |
How to handle each error
INVALID_API_KEY — 401
INVALID_API_KEY — 401
Your API key is missing from the request or is not recognised. This is returned when the
Authorization header is absent, malformed, or contains a key that does not exist in the system.What to do:- Confirm the
Authorizationheader is present and formatted asBearer ltx_your_key. - Check that the key has not been rotated. If you recently called
POST /v1/keys/rotate, the old key is immediately invalidated. - If you do not have a key, register your agent via
POST /v1/registerto obtain one.
RATE_LIMIT_EXCEEDED — 429
RATE_LIMIT_EXCEEDED — 429
Your agent has exceeded the per-minute request limit for your tier (60/min on Free, 600/min on Pro).What to do:
- Read the
Retry-Afterresponse header. It contains the number of seconds to wait before retrying. - Implement exponential backoff if you are hitting this limit repeatedly.
- If your agent’s workload regularly exceeds 60 requests per minute, upgrade to the Pro tier.
OVER_LIMIT — no HTTP error
OVER_LIMIT — no HTTP error
The Free tier lifetime cap of 300 calls has been reached. Unlike other errors,
OVER_LIMIT does not produce an HTTP error status. The search response returns normally with HTTP 200, but over_limit is set to true in the usage object.What to do:- Check
usage.over_limitin every search response if you are on the Free tier. - When
over_limitistrue, follow theupgrade_urlvalue in theusageobject to initiate a Pro upgrade. - Calls made after the cap is reached still return results, but you should prompt your users to upgrade to avoid interruption.
AGENT_ALREADY_EXISTS — 409
AGENT_ALREADY_EXISTS — 409
The combination of
agent_name and owner_identifier you sent to POST /v1/register is already registered in the system.What to do:- If you already have a key for this agent, retrieve it from wherever you stored it at registration time. Keys are shown only once.
- If you have lost the key, rotate it via
POST /v1/keys/rotateusing your existing key, or contact support. - If you want to register a new agent, use a different
agent_nameorowner_identifier.
UPSTREAM_ERROR — 502
UPSTREAM_ERROR — 502
The upstream search provider returned an error or did not respond in time. This is a transient condition — the Lithtrix service itself is healthy.What to do:
- Retry the request after a short delay (start with 1–2 seconds).
- Use exponential backoff if retries continue to fail.
- If the error persists for more than a few minutes, check the Lithtrix status page for upstream incident reports.
SERVICE_UNAVAILABLE — 503
SERVICE_UNAVAILABLE — 503