Limits & quotas
Every limit on cloud measurements and the API, the per-key controls you set, and how to handle rate limiting.
Fixed limits apply to every organization. Per-key controls are yours to set: they cap traffic and spend for each integration separately.
Limits
| Limit | Value |
|---|---|
| Cloud session length | 20–180 seconds, default 60 |
| Session token | Valid for 5 minutes, one measurement |
| Video file | Up to 256 MB, 20–180 seconds, at least 20 fps |
| Upload URL | Valid for 15 minutes |
| Uploaded file | Deleted when its job finishes, at most 1 hour after the upload URL was created |
| JSON request body | 256 KB. A larger body fails with 413 payload_too_large |
| Request signature | Timestamp within 5 minutes of server time; each nonce accepted once |
idempotencyKey | 16–200 characters |
userRef | 1–64 characters |
Usage log, GET /sdk/v1/logs | 60 requests per minute per key |
| Report creation | 30 per hour per key |
| Organization webhooks | 5 endpoints |
| Webhook delivery | 3 attempts, 10 seconds each |
| Requests per minute per key | Your setting, up to 6,000 |
Per-key controls
Set them for each key in Console → Keys → Limits & scopes. Changes apply immediately.
| Control | Values | When exceeded |
|---|---|---|
| Requests per minute | 0 (no limit) to 6,000 | 429 rate_limited on any signed request |
| Cloud seconds per month | Any number, or no limit | 403 quota_exceeded when you create a session or job |
| Monthly spend ceiling | Amount in USD, stored in tokens | 403 token_quota_exceeded when you create a session or job |
| Metric sets | Any of hrv, bp, spo2, emotion, gaze; none selected means all | 403 feature_not_allowed when a session or job requests another set |
Monthly quotas start over on the first day of each calendar month, UTC.
- Cloud seconds. A session is refused when its
durationSecdoes not fit into the seconds left this month. A video job is refused once the month's seconds are used up. - Spend ceiling. Checked against the estimated cost of the session or job — see Pricing.
- Running measurements. A measurement that has started always finishes. Limits apply when you create the next one.
- Test keys. The rate limit and metric sets apply. Cloud seconds and the spend ceiling do not.
The organization balance is a separate check: 403 insufficient_tokens when it cannot
cover the estimate.
Read the current values
POST /sdk/v1/auth/test returns the calling key's settings:
| Field | Description |
|---|---|
rateLimitPerMin | Requests per minute. 0 means no limit |
quotaSecondsMonth | Cloud seconds per month. null means no limit |
tokenQuotaMonth | Monthly spend ceiling, tokens. null means no limit |
features | Allowed metric sets. null means all |
tokenBalance | The organization's token balance |
Rate limiting
When a limit applies to a request, the response carries three headers:
| Header | Description |
|---|---|
RateLimit-Limit | Requests allowed in the current window |
RateLimit-Remaining | Requests left in the current window |
RateLimit-Reset | Seconds until the window resets |
The window is one minute for the per-key limit and for the usage log, and one hour for report creation.
On 429 rate_limited, wait RateLimit-Reset seconds, or back off exponentially with
jitter. Sign every retry again: a rate-limited request has already used its nonce, so
resending the same signed request fails with 401 unauthorized.
async function withBackoff(send, maxAttempts = 5) {
for (let attempt = 1; ; attempt += 1) {
const res = await send();
if (res.status !== 429 || attempt === maxAttempts) return res;
const resetSec = Number(res.headers.get('RateLimit-Reset'));
const delayMs = resetSec > 0 ? resetSec * 1000 : 1000 * 2 ** (attempt - 1);
await new Promise((resolve) => setTimeout(resolve, delayMs + Math.random() * 500));
}
}
const res = await withBackoff(() =>
fetch('https://neccessory.com/sdk/v1/logs?limit=200', {
headers: signedHeaders('GET', '/sdk/v1/logs', ''),
}),
);signedHeaders() is the signing helper from Cloud sessions.
The function passed to withBackoff signs each attempt anew.
Limits API
GET /api/v1/limits returns the fixed limits. It needs no signature. Call it from your
server — it is not available from the browser.
{
"ok": true,
"data": {
"keyRateLimitPerMinMax": 6000,
"orgWebhookLimit": 5,
"webhookAttempts": 3,
"measurementBaseDurationSec": 30,
"cloudMinDurationSec": 20,
"cloudMaxDurationSec": 180,
"exportRowCap": 50000,
"maxWindowDays": 366
}
}| Field | Description |
|---|---|
keyRateLimitPerMinMax | Highest requests-per-minute value you can set on a key |
orgWebhookLimit | Webhook endpoints per organization |
webhookAttempts | Delivery attempts per webhook event |
measurementBaseDurationSec | Measurement length behind the reference price, seconds |
cloudMinDurationSec, cloudMaxDurationSec | Allowed cloud session length, seconds |
exportRowCap | Most rows in one console export |
maxWindowDays | Longest custom date range in console views and exports, days |
Every error code and its fix is listed in Errors.