Leni developers
Usage, billing, and limits
The project key determines environment, quota, rate limits, and billing. Sandbox, development, and production use the same HTTPS base URL.
| Key environment | Per-key limit | Usage behavior |
|---|---|---|
| Sandbox | 5 requests per 60 seconds | Default allowance is 100 successful calls per calendar month (UTC); the key response is authoritative. |
| Development | 60 requests per 60 seconds | Rate limited and metered according to the account attached to the key. No sandbox monthly-call allowance applies. |
| Production | 120 requests per 60 seconds | Metered analysis consumes included subscription credit first, then funded API credits when available. Non-analysis reads still count toward request limits. |
How the request limit is counted
- The window is a fixed 60-second window keyed by the authenticated project key.
- Every authenticated attempt that reaches the limiter counts, including requests that later return 4xx or 5xx.
- The published limit is the client budget. Keep sustained traffic below it instead of probing for the exact boundary.
- HTTP 429 includes
Retry-AfterandretryAfterSeconds. Wait at least that long and add jitter before retrying. - No remaining-request response header is currently part of the public contract.
Current pricing
Exact rates, available credits, and spending controls are shown in the authenticated Leni account. Integrations should not hard-code a dollar balance or model price.
Rate-limit response
HTTP/1.1 429 Too Many Requests
Retry-After: 42
{
"error": "RATE_LIMIT_EXCEEDED",
"limit": 5,
"windowSeconds": 60,
"retryAfterSeconds": 42,
"environment": "sandbox"
}Limits are independent
| Control | Applies to | When consumed |
|---|---|---|
| Per-minute request limit | All authenticated HTTP API calls | Every attempt reaching the rate limiter |
| Sandbox monthly allowance | Sandbox keys only | Successful 2xx and 3xx calls |
| Analysis usage | Metered run-models work outside sandbox | According to the account plan and analysis result |
| API-credit spending control | Funded API-credit spillover | After included plan usage is unavailable |
These controls overlap. Passing one does not bypass another. A production key can be below its per-minute limit and still receive HTTP 402 when neither plan usage nor funded API credits are available.
Sandbox quota
A sandbox request is decremented only after a successful 2xx or 3xx response. Failed 4xx or 5xx requests do not consume the reserved call. The allowance resets lazily at the first request after 00:00 UTC on the first day of the next calendar month.
HTTP/1.1 402 Payment Required
{
"error": "SANDBOX_LIMIT_EXCEEDED",
"message": "Sandbox API call quota exhausted for this key.",
"sandboxLimit": 0,
"sandboxLimitResetAt": "<ISO-8601 timestamp>",
"environment": "sandbox"
}Analysis usage order
- Leni checks whether the account may start the requested analysis.
- Available included plan usage is consumed first.
- Free and Enterprise accounts can spill into funded API credits when available.
- If no eligible usage remains, the request returns HTTP 402 without starting new compute.
Do not infer dollars from API usage
Product pricing and balances can change independently of this transport contract. Use the authenticated Leni account for current pricing, balances, and spending controls.