Lucius API

Errors

HTTP status codes and error response format.

The API uses standard HTTP status codes and returns errors as JSON with an error field.

Error format

All errors follow this shape:

{
  "error": "Human-readable error message"
}

Some validation errors on usage submission include per-event details:

{
  "accepted": 0,
  "rejected": 1,
  "events": [
    {
      "event_id": "evt-001",
      "status": "rejected",
      "error": "Metric 'unknown_metric' not in pricing program"
    }
  ]
}

Status codes

CodeMeaningWhen
200SuccessRequest completed successfully
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing, invalid, or expired API key
404Not FoundResource doesn't exist or doesn't belong to your account
500Internal Server ErrorSomething went wrong on our end

Common errors

Authentication errors (401)

ErrorCause
Missing API keyNo Authorization or X-Api-Key header
Invalid API keyKey doesn't match any active key
API key expiredKey has passed its expiration date

Usage submission errors

These appear in the events array with status: "rejected":

ErrorCause
Contract not found or has no customerThe external_contract_id doesn't match any active contract
No approved pricing programThe contract doesn't have an approved pricing program yet
Metric 'X' not in pricing programThe metric name doesn't match any usage rule

Not found errors (404)

Returned when looking up a specific resource:

{
  "error": "Not found"
}

This means either the resource doesn't exist or it belongs to a different company.

Retry guidance

  • 401 — Don't retry. Fix your API key.
  • 404 — Don't retry. Check the resource ID.
  • 400 — Don't retry. Fix the request.
  • 500 — Safe to retry with exponential backoff. Usage submissions are idempotent via event_id.

On this page