Skip to main content

Two layers of rate limiting

Burst protection (per credential)

A short sliding window of 10 seconds caps the number of requests any single credential can send. When exceeded, the credential is blocked for 60 seconds and the API returns 429 RATE_LIMITED with retry_after_seconds: 60. This protects against runaway devices and credential misuse.

Sustained rate limit (per session)

A guardrail rule (configured per kiosk in the admin panel) limits the number of messages per minute within a single session. This is the primary tool for controlling cost and preventing abuse by end users.

Rate limit response

This HTTP error shape applies to POST /v1/sessions and other REST calls. If the sustained limit is hit mid-conversation, the WebSocket instead sends {"type":"error","code":"TURN_ERROR","message":"RATE_LIMITED: ..."} — see WebSocket streaming.
When either limit is hit over HTTP, the API returns:
The response includes both a standard Retry-After HTTP header and details.retry_after_seconds in the body — they carry the same value. Standard HTTP clients (curl, many libraries) can read the header directly. Read either source and wait at least that many seconds before retrying.

Retry strategy

1

Check the status code

429 is the only retriable rate limit response. Do not retry 400, 401, or 403 — those indicate a problem that retrying will not fix.
2

Read retry_after_seconds

Use the value from details.retry_after_seconds. If absent, default to 5 seconds.
3

Add jitter

When multiple devices share a credential, add random jitter (0–2 s) to prevent a thundering-herd of retries at exactly the same moment.
4

Cap your retries

Retry at most 3 times. If still rate-limited after 3 attempts, surface an error to the user rather than spinning indefinitely.

Configuring limits

Sustained session rate limits are set in the admin panel:
  1. Open your workspace.
  2. Navigate to Kiosk → Guardrails → Rate limit.
  3. Set Max messages per minute and Max tokens per turn.
Burst limits are fixed per plan and cannot be configured. Contact support if your legitimate traffic pattern regularly hits the burst limit.