Rate limiting & idempotency

Per-tenant quotas, retry-safe writes, and how to read the rate-limit headers.

Per-tenant quotas

Each tenant gets a sliding-window RPS budget (default 30 RPS on paid tenants, 5 on free). The window is enforced per minute. Heavy batch endpoints (translation batch, scrape crawl) consume against a separate background budget so they don't starve interactive calls.

Reading rate-limit headers

Every response carries:

  • X-RateLimit-Limit — the bucket ceiling.
  • X-RateLimit-Remaining — credits left in this window.
  • X-RateLimit-Reset — seconds until the bucket refills.

On 429, retry after at least Retry-After seconds. The SDK does this automatically with capped exponential backoff.

Idempotency keys

Mutating endpoints accept an Idempotency-Key header. If Valienz sees the same key within 24 hours, it returns the original response — no duplicate side effect. Use a fresh UUIDv4 per logical operation.

curl -X POST https://api.valienz.io/v1/email/send \
  -H "Authorization: Bearer $VALIENZ_API_KEY" \
  -H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

Quota errors

CodeHTTPDescriptionResolution
E_QUOTA_EXCEEDED429Tenant exceeded its RPS or per-day budget.Honor `Retry-After`, then back off exponentially. Upgrade the plan or contact support for a higher cap.
E_IDEMPOTENCY_KEY_REUSED409The same idempotency key was used for a different request body.Use a unique key per logical operation. Reusing requires byte-identical bodies.