Founding churches get 50% off for 12 monthsFounding churches: 50% offApply as a founding churchApply

Usage and limits

GET /usage tells you what the calling key can do, what its limits are, and what it has used in the last 30 days. It works with any valid key.

Read usage#

GET/usageany valid key
curl "$LECTERN_BASE_URL/v1/api/o/$LECTERN_SLUG/usage" \
  -H "Authorization: Bearer $LECTERN_API_KEY"
{
  "status": true,
  "message": "ok",
  "data": {
    "id": "apk_01m4h7y3ywefgb8nt54y776hza",
    "name": "Docs verification",
    "prefix": "lk_live_01m4h7_...",
    "scopes": [
      "teachings:read",
      "teachings:ingest",
      "notes:read",
      "notes:generate",
      "ask:use",
      "scripture:read",
      "webhooks:manage"
    ],
    "status": "active",
    "created_at": "2026-10-09T21:08:34Z",
    "last_used_at": "2026-10-09T21:19:56Z",
    "rpm_limit": 600,
    "daily_cap_micros": null,
    "monthly_cap_micros": null,
    "monthly_teaching_limit": null,
    "ip_allowlist": [],
    "usage": {
      "requests_30d": 53,
      "errors_30d": 21,
      "spend_today_micros": 1465,
      "spend_month_micros": 1465,
      "teachings_month": 3,
      "daily": [
        {
          "day": "2026-10-07",
          "requests": 0,
          "errors": 0,
          "spend_micros": 0
        },
        {
          "day": "2026-10-08",
          "requests": 0,
          "errors": 0,
          "spend_micros": 0
        },
        {
          "day": "2026-10-09",
          "requests": 53,
          "errors": 21,
          "spend_micros": 0
        }
      ]
    }
  },
  "meta": {
    "request_id": "req_01m4h8nry7eq2bfwf822ry0vwm"
  }
}
FieldMeaning
name, prefix, statusWhich key this is. prefix is the start of the key, so you can recognise it.
scopesWhat the key may do.
rpm_limitRequests per minute.
daily_cap_micros, monthly_cap_microsSpend caps in millionths of a US dollar, or null for no cap.
monthly_teaching_limitTeachings the key may submit per month, or null.
ip_allowlistAddresses the key may be used from. Empty means any.
expires_atWhen the key stops working, if it has an expiry.
usage.requests_30d, usage.errors_30dRequests and errors in the last 30 days.
usage.spend_today_micros, usage.spend_month_microsAI spend today and this month.
usage.teachings_monthTeachings submitted this month.
usage.dailyA day-by-day series of requests, errors and spend.

Spend is in millionths of a US dollar: 1000000 is one dollar. To show dollars, divide by 1,000,000.

How limits reach your code#

  • Request limits show up as RateLimit-* headers on every response and as 429 rate_limited when exceeded. See Rate limits.
  • Spend caps and teaching limits show up as 429 errors with a specific code when you try to start more work. Reading keeps working.
  • Plan hours show up as 403 plan_hours_exhausted when a new teaching would go over the hours included in the church’s plan.
  • Upload limits are in GET /uploads/policy, with the church’s usage against each.
A health check

A scheduled call to GET /usage that checks the status, the expiry and the spend is a cheap way to find a key that is about to expire or a cap that is close.

Church-wide caps

A church can also cap total API spend across all its keys. GET /usage shows the key’s own numbers; the church-wide cap is managed by the church in Lectern and shows up as 429 org_api_cap_reached when reached.

Next steps