SyvonError.
SyvonApiError.body is the parsed JSON when the server returned JSON (most routes do), exposing the server’s error / code / message fields.
Statuses you should handle
- 401 — token missing, invalid, or expired. Refresh the portal JWT, or the workspace key is wrong/revoked.
- 402 — plan-gated operation. For example minting a key on a single-workspace plan (
API_KEYS_NOT_AVAILABLE). - 403 — authenticated but not allowed. Not an owner, not a member, or an R2 prefix the proxy does not allowlist.
- 404 — wrong id, or the resource is not published yet (brain read surface).
- 429 — rate limited. Back off and retry.
Example
Rate limiting
The chat endpoint applies per-visitor caps when the request carries aclient hash (a salted hash your app mints; never a raw IP). Without it, the whole workspace shares a looser backstop. A rate-limited turn returns 429; wait and retry.