openreader/docs-site/docs/configure/tts-rate-limiting.md
Richard R fc3d05d65b feat(rate-limit): add per-user PDF parsing rate limiting and job event ledger
implement a generic user_job_events table for tracking compute job creation
enforce configurable burst and sustained limits for PDF layout parsing
add admin panel controls for compute rate limiting and max upload size
update API routes to apply and record rate checks for PDF parse jobs
document new environment variables and admin settings for compute limits
improve IP extraction logic for rate limiting accuracy
add tests for request IP extraction and test namespace gating

This change introduces a robust mechanism to throttle expensive compute operations, such as PDF parsing, on a per-user basis. It provides both burst and sustained rate controls, with admin-tunable parameters and clear user feedback on throttling. The job event ledger enables accurate concurrency and rate enforcement, while new documentation and tests ensure maintainability and clarity.
2026-05-30 14:17:49 -06:00

1.7 KiB

title
TTS Rate Limiting

This page explains OpenReader's TTS character rate limiting controls.

Overview

  • TTS rate limiting is disabled by default.
  • Primary control is Settings → Admin → Site features → Disable TTS daily rate limiting.
  • Optional first-boot seed: RUNTIME_SEED_DISABLE_TTS_LIMIT=true.
  • Limits are enforced per day in UTC.
  • Enforcement applies only when auth is enabled.

How enforcement works

When enabled, OpenReader enforces:

  • Per-user daily character limits.
  • IP backstop daily character limits.
  • Anonymous device backstop tracking (cookie-based) to reduce limit resets.

If a request exceeds the active limit, the TTS API returns 429 with reset metadata for the next UTC day.

Required auth behavior

  • Auth must be enabled (BASE_URL + AUTH_SECRET) for TTS char limits to apply.
  • If auth is disabled, TTS character limits are effectively unlimited.
  • DISABLE_AUTH_RATE_LIMIT only affects Better Auth's own request throttling.
  • DISABLE_AUTH_RATE_LIMIT does not disable TTS character limits.

Runtime config + seed var

  • First-boot seed toggle: RUNTIME_SEED_DISABLE_TTS_LIMIT (default: true)
  • Per-user and IP backstop limit values are configured in Settings → Admin → Site features and stored in DB runtime settings.