Skip to main content

Error Response Formats

Errors have two shapes depending on the source: Auth/middleware errors (401, 403, 429):
Handler errors (400) — when a handler returns success: false:

Error Codes

Authentication (401)

Authorization (403)

Rate Limiting (429)

Handler Errors (400)

When a handler returns success: false, the API responds with the error message and metadata. These are domain-specific errors like invalid parameters or missing data.

Circuit Breaker (503)

When an upstream dependency is unavailable:
The circuit breaker opens after repeated failures to an upstream provider (Morpho, Aave). It auto-closes after the retryAfterMs window.

Internal Errors (500)

Unhandled exceptions return a generic error. Stack traces are included only in non-production environments.

Not Implemented (501)

When a requested feature is not yet available: