Kernlift

Rate limits

Set the API-key request limits and choose an in-memory or Redis counter backend.

/admin/rate-limits configures API-key traffic: one default limit and overrides for AI generation, AI status and asset upload. Authentication and webhook protection have separate runtime paths. This page does not edit their rules.

Before you begin

  • An account with config.read to see the page and config.write to change the backend. See Roles and permissions.
  • Memory is the default backend. Configure Redis for shared counters across application instances.

Set it up

Look at the rules you already have

Open /admin/rate-limits. The form shows the default limit and three endpoint overrides. These values are stored in admin config, not in the separate rate_limit_rules audit table.

Pick a backend

Memory counts inside one process. Separate Workers isolates or Node containers each keep their own counters. Select Redis and provide a connection URL to share counters across instances.

The URL is stored as an admin config secret and is never returned to the browser. The page shows only whether a URL is set.

Tune a rule

Set the default request cap and window, then adjust any endpoint-specific caps and windows.

API-key limits on this page

KeyEndpoint patternDefault
Default API-key limitOther scoped API-key requests100 requests per 1-second window
ai_generate/api/{scene}/generateInherits the default until changed
ai_status/api/statusInherits the default until changed
assets_upload/api/assets/uploadInherits the default until changed

The form accepts a cap of 1–10,000 requests and a window of 1–3,600 seconds for each entry.

Backend

Prop

Type

When adding a default rule, update defaultRateLimitRules and run insertMissingRateLimitRules. Existing deployments receive the new rule, and operator changes are not overwritten.

Verify

  1. Open /admin/rate-limits. Three endpoint overrides and the default API-key limit are listed.
  2. Switch the backend to Redis without a URL. The page rejects the save. It does not fall back to memory.
  3. Save a Redis URL, reload the page. It reports that a URL is configured and does not display it.

Reference

Next steps