Retries, errors and quota
Retries
Both clients retry 429, 500, 502, 503 and 504 responses and network errors, twice by default. They wait
Retry-After when the API sends it, and otherwise back off exponentially with jitter (0.5 s, 1 s, 2 s, capped at 8 s).
QUOTA_EXCEEDEDis never retried: the monthly quota resets at 00:00 UTC on the 1st, not in seconds.- A
Retry-Afterlonger than the maximum (60 s by default) raises at once instead of waiting. - Refused requests are not billed. See rate limits and quota.
Errors
Every failure is one type, FlipziError, built from the API's error body
{"error": {"code", "message", "details", "request_id"}}:
| Field | |
|---|---|
status | HTTP status; 0 when no response arrived |
code | e.g. CARD_NOT_FOUND, PLAN_FEATURE_LOCKED, RATE_LIMITED; NETWORK_ERROR or TIMEOUT with status 0 |
message | readable explanation |
details | always an object: next_step, and on plan refusals your_plan, next_plan, upgrade_url |
requestId / request_id | quote it to support |
Quota headers
Metered responses carry X-Quota-Limit, X-Quota-Remaining, X-Quota-Period and the X-RateLimit-* headers.
The clients parse them into lastResponse (TypeScript) or last_response (Python), and pass every response's
figures to an onResponse / on_response hook if you set one. quotaRemaining is the count when the request arrived,
before its own cost. usage() returns the same figures, per key, and costs nothing.
Bulk caps
The bulk endpoints take up to your plan's cap of ids per request. The clients learn the cap from the API on the first
call (an over-cap request is refused before it is billed, and the refusal names the cap), split the ids to it and
merge the answers. Pass chunkSize / chunk_size to set it yourself.
Versions
Both packages follow semantic versioning and are released together with the same version number. A new SDK version
comes when the API adds endpoints or parameters, not with every API release. Older versions keep working: new
response fields pass straight through, game and grade arguments accept any value, and request() reaches any route.