cloakDocs

Rate limits & errors

Daily caps, 429 responses, size limits, and fail-open behaviour.

Daily caps

TierRequests / dayPages / dayCounted per
Keyless (free)60200IP address
API key2,00010,000key

Both a request count and a page count apply — you hit the cap when either is exceeded. Counters reset daily (UTC).

When you hit the cap — 429

Over the keyless limit:

{ "detail": "Daily free limit reached — try again tomorrow, or get in touch for a higher limit." }

Over a keyed limit:

{ "detail": "Daily key limit reached — try again tomorrow, or get in touch for a higher limit." }

If you're seeing the free message while sending a key, the key wasn't accepted — check the Authorization header and that the key hasn't been revoked.

Size limits — 413

LimitValue
Max file size20 MB
Max pages30
{ "detail": "file exceeds 20 MB limit" }
{ "detail": "PDF exceeds 30-page limit (42 pages)" }

Other errors

StatusMeaning
400options was not valid JSON, or style was not one of pattern / blackout / label
422The request was malformed (e.g. missing the file field)
500Detection or redaction failed while processing the document

Fail-open by design

Cloak is built so the auth and metering layer can never take redaction down:

  • Key validation is fail-open. If the key backend is briefly unreachable, a request is simply treated as keyless (it falls back to the per-IP tier) rather than being rejected. A redaction is never hard-failed because auth blipped.
  • Metering is best-effort. The per-IP counters live in memory (no IP is ever persisted); if the process restarts, counters reset. The keyed usage total is written durably and can only ever increase, so a transient blip can't clobber it.

The practical upshot: the worst case for a metering hiccup is that you get the free limit for a moment, not an outage.