Features
API key request limits
Requires a license with the
apikey-profeature. See pricing.
A request limit caps how many requests one API key may make in a
clock hour, a day or a calendar month. A key can carry any of the three. Once
it reaches one, every further request answers 429 until that window ends or
you raise the limit. Everything else about keys,
from creating them to reading their history, stays free on every install.
In the console
Link to the section In the consoleOpen Access > API keys. The Usage (this month) column shows each key's
requests, with a bar for a key that has a monthly limit and its other limits
below it, such as Also 3/h. To change a key's limits, choose its
Request limits button. The drawer has Per hour, Per day and
Per month, where 0 sets no ceiling, and Save applies them. The
New key form has the same three fields under Request limits.

How it works
Link to the section How it works| Question | Answer |
|---|---|
| What is counted | Every request the key makes on the Content API, whatever it answers, except the ones refused at a limit. |
| When the count resets | On the hour, at midnight and on the first of the month, each in UTC. A limit set partway through a window counts from then. |
| What a key over its limit gets | 429 with X-RateLimit-Exceeded: true, Retry-After in seconds until the window ends, and {"error": "hourly request limit (1000) exceeded", "window": "hourly"}. When several limits are spent, the answer names the one that resets last. |
| How the limits relate | A shorter window's limit cannot be above a longer one's, because it could never be reached. |
What 0 means | No limit. It is the default. |
| Who counts | Usage and quotas, which runs on every install. If the count cannot be read, the request goes through. |
| How exact it is | The count is checked before a request and written after it, so requests that arrive together can pass a limit by as many as are in flight at once. |
Run this on an install whose license carries apikey-pro, signed in as an
admin or super_admin. The quickstart
creates the post content type used here, and the key's viewer role needs
an access rule that reads post, as step 1 of
API keys creates.
Create a key that may make three requests an hour:
Console v0.28.0
- Open Access > API keys and choose New key. Enter
partner-feedin Name. Under Roles, untick editor, which the form ticks for you, and tick viewer. - Leave Content on Every content type with Read ticked.
- Under Request limits, enter
3in Per hour and1000in Per month, then choose Create. - Copy the key from API key created into
KEY. It is shown once.
Engine API v0.62.0
You need an admin or super admin token in TOKEN. The quickstart shows how to get one.
curl -X POST http://localhost:3001/api/admin/api-keys \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "partner-feed", "roles": ["viewer"], "scopes": ["content:read"], "hourly_limit": 3, "monthly_limit": 1000}'The answer is 201 with "hourly_limit": 3 and "monthly_limit": 1000.
Copy raw_key into KEY and id into KEY_ID. raw_key is shown once.
Call the Content API four times with the key. This is the same on both paths:
for i in 1 2 3 4; do curl -s -o /dev/null -w "%{http_code}\n" http://localhost:3002/api/v1/content/post \ -H "X-API-Key: $KEY"doneYou see 200, 200, 200, then 429. The fourth answer carries
Retry-After with the seconds left in the hour.
Read the key's use this month:
Console v0.28.0
On Access > API keys, the key's row shows 3 req under Usage (this month), with Also 3/h below the bar. The refused fourth call is not counted.
Engine API v0.62.0
curl http://localhost:3001/api/admin/usage/api-key/$KEY_ID \ -H "Authorization: Bearer $TOKEN"{ "api_key_id": "b0872381-...", "tenant_id": "default", "billing_period": "2026-10", "requests": 3, "bytes_in": 0, "bytes_out": 540 }The refused fourth call is not counted.
Clear the hourly limit, and the key is served again:
Console v0.28.0
Choose the key's Request limits button. Set Per hour to 0 and choose
Save. Also 3/h goes from the row, and Per month keeps 1000.
Engine API v0.62.0
curl -X PATCH http://localhost:3001/api/admin/api-keys/$KEY_ID/limits \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"hourly_limit": 0}'The answer is the key with "hourly_limit": 0 and its monthly limit
unchanged, because a field the body leaves out keeps its value.
Set or change a limit
Link to the section Set or change a limitConsole v0.28.0
Give a new key limits under Request limits in the New key form, or choose an existing key's Request limits button on Access > API keys, change Per hour, Per day or Per month and choose Save.
Engine API v0.62.0
Give a new key limits with hourly_limit, daily_limit and monthly_limit on
POST /api/admin/api-keys, as in Try it, or change the limits of
an existing key:
curl -X PATCH http://localhost:3001/api/admin/api-keys/$KEY_ID/limits \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"daily_limit": 5000, "monthly_limit": 100000}'PATCH /api/admin/api-keys/{id}/monthly-limit still sets the monthly limit
alone.
Both routes, and LyEve Console's forms, take an admin or super_admin with a
signed-in session. An admin token or another API
key is refused.
Each limit is judged on its own:
| Write | Needs apikey-pro |
|---|---|
Create a key with any limit above 0 | Yes |
| Give a key with no limit its first one | Yes |
| Raise a key's limit | Yes |
| Lower a key's limit | No |
Clear a limit with 0 | No |
| Send back the value the key already holds | No |
If the license lapses
Link to the section If the license lapsesEvery limit you set keeps being enforced, because it caps what a client can
spend and a lapse must not lift it. Lowering and clearing a limit stay free, so
you can still tighten a key you worry about. Setting a first limit or raising
one needs apikey-pro again.
| Status | Message | Cause |
|---|---|---|
400 | validation failed on field "monthly_limit" | A limit is below 0. |
402 | payment_required, naming feature:apikey-pro | The write sets a first limit or raises one without apikey-pro. Nothing is stored. |
404 | api key not found | No key with that id in your tenant. |
422 | daily_limit (<n>) is above monthly_limit (<n>), so it can never be reached | A shorter window's limit is above a longer one's. |
429 | hourly request limit (<n>) exceeded, or daily or monthly | The key used that limit for the current window. |
The 402 body in full:
{"error": "payment_required", "plugin": "apikey", "feature": "feature:apikey-pro", "upgrade_url": ""}The other errors of the key routes are on API keys.
Related
Link to the section Related- API keys: scopes, roles, expiry and each key's request history.
- Usage and quotas: the counts behind the limit, and billing snapshots.
- Tenant quotas: limits on a whole tenant.
- Rate limiting: limits per second and per minute.