Integrate · Concept
Rate limits
Rate limits are per-minute caps on how many requests one caller can make to each group of endpoints, which keep a shared API responsive. Every response says how much of the current limit is left, and a request over it gets a 429 that says when to retry.
When to use it
- Pace a batch job so it doesn't hit
429. - Handle a
429with the right wait instead of guessing. - Understand why a keyless endpoint, such as the free verify endpoint, is throttled by IP.
How it works
- Each request is counted in a 60-second window, for the endpoint group it belongs to.
- It's counted against the caller: the API key, the signed-in console session, or the client IP when there's no credential. The embed render endpoints count against the embed token, or against the publishable key and the client IP together when the token isn't one Provenance issued for that key's account. A publishable key is public, so someone who copies it from your page uses up only their own share, not your visitors'. A publishable key Provenance doesn't recognize, or one that's revoked, counts against the client IP.
- Over the limit, the API answers
429rate_limit_exceededwith aRetry-Afterheader, and doesn't run the request.
| Endpoints | Requests per minute |
|---|---|
POST / | 500 |
POST / and capture sessions | 200 |
Embed render endpoints, POST / | 120 |
| Most other endpoints | 100 |
| The public trace registry and trace shares | 60 |
POST /, /, trace disclosure | 30 |
POST / | 20 |
POST /v1/attest/media/screen also has an hourly cap per IP, because each screening calls a paid external detector. Sign-in links have a separate limit per email address.
Headers
Every response, including successful ones, carries the current window. Check them on any request:
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
curl -s -o /dev/null -D - $PROVENANCE_API/v1/attest/claims \
-H "Authorization: Bearer $PROVENANCE_KEY" | grep -i ratelimit
const res = await fetch(`${process.env.PROVENANCE_API}/v1/attest/claims`, { headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}` } });
console.log(res.headers.get("x-ratelimit-remaining"));
import os
import httpx
res = httpx.get(f"{os.environ['PROVENANCE_API']}/v1/attest/claims", headers={"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"})
print(res.headers["x-ratelimit-remaining"])
x-ratelimit-limit: 100
x-ratelimit-remaining: 99
x-ratelimit-reset: 1792856810
X-RateLimit-Limitinteger- The limit for this endpoint group.
X-RateLimit-Remaininginteger- Requests left in the current window.
X-RateLimit-Resetinteger- When the oldest counted request leaves the window, as a Unix time.
Retry-Afterinteger- On a
429only: seconds to wait before retrying.
Back off on a 429
Wait for Retry-After seconds, then retry with exponential backoff and a little random jitter. Better still, slow down when X-RateLimit-Remaining gets low. The Node and Python SDKs retry 429 and 5xx responses for you, honoring Retry-After, up to three times.
Related
- Errors
- Plans and usage, for monthly allowances, which are separate from rate limits
- SDKs