Error format
Every API error returns a stable code plus a human-readable message:retry_after_seconds above) — there is never a nested details object. Branch on the error code, not the message text; messages can change.
Casing convention: routes authenticated with a session or organization key return UPPER_SNAKE codes (UNAUTHORIZED, PLAN_LIMIT_REACHED). Routes authenticated with an agent API key return lower_snake codes (unauthorized, agent_disabled, scope_denied).
Request validation failures are the one exception to the shape above — they return Fastify’s standard
400 body, where the machine code lives in code:Common error codes
Rate limits
Limits are applied per organization and scale with plan tier:
Some sensitive routes carry additional, tighter per-route caps (for example, withdrawals and agent creation), so you can see a
429 on a specific route while well under your org-wide limit.
Every response carries usage headers:
Handling 429s
- Wait at least
retry_after_seconds(or theretry-afterheader) before retrying — don’t hammer. - For write requests, retry with the same idempotency key: the retry is deduplicated and will never double-spend. See the payment workflow for how idempotency keys behave.
- If you’re consistently hitting limits at legitimate volume, contact support about your plan’s limits.