Leni HTTP API
Usage, billing, and limits
The project key determines environment, quota, rate limits, and billing. Sandbox 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. |
| 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 rate limits. |
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"
}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"
}