Limits, quotas and errors · FAQ
Which errors does the Casafari REST API return, and which should I retry?
On the Casafari REST API, retry only 5xx errors with backoff; the self-serve platform's REST API returns application/problem+json errors, such as 402 payment_required, that need action before a retry.
If you're a Casafari client: the Casafari REST API documents these errors:
401on/loginor/refresh-token: wrong credentials or an expired refresh token; log in again.401on/oauth/token: wrong client credentials, or the API client was rotated or revoked; ask the account owner for the currentclient_idandclient_secret.422on/login: sendemailandpasswordas JSON.5xx: transient; retry with exponential backoff.
See REST API and REST authentication.
If you're new to Casafari: each error type has a page at https://platform.casafari.com/errors/<code>.
402 payment_required: units ran out. It carries anupgrade_urland aLinkheader withrel="payment"; a person pays, then your code retries (handling a 402). With the reasonspending_cap_reached, it lasts until the period ends or the cap is raised.429 usage_limit_reached: an Agent usage window is used up and no credits remain. It carries the reset time, aRetry-Afterheader and anupgrade_url; retry after the reset or once credits are bought.verification_required: applies to AgentGraph AI, which has no REST operations.429 request_limit_reached: a request guard is used up; retry afterRetry-Afterseconds.429 daily_limit_reachedresets at 00:00 UTC. All are on Limits and usage windows.
Other codes and 5xx retry rules are not published; Casafari can answer (https://www.casafari.com/). See also which errors to retry.