All Ratio API errors follow a consistent JSON envelope with machine-readable codes for programmatic handling.
A few errors are returned as plain-text (non-JSON) bodies: 422 for a request body with the wrong shape, 415 for a POST without Content-Type: application/json, and 400 when the body is not valid JSON or the query string cannot be parsed. Gateway errors (e.g. missing auth headers) are JSON but have no meta. Always check Content-Type before parsing as JSON.
Error codes by endpoint
Quote errors (POST /v1/quote, POST /v1/firm-quote)
Execution lookup errors (GET /v1/executions)
Corridor and rate errors
Retry guidance
Best practices
- Handle errors by HTTP status first;
error.code provides more specific detail. New codes may be added at any time — handle unrecognised codes by their HTTP status.
- Log
meta.request_id for every error. This is essential for support escalation.
- Check
GET /v1/corridors proactively to see corridor state before sending quote requests.
- A
404 on GET /v1/executions after an on-chain transaction usually means the indexer hasn’t caught up — retry in 3–5 seconds, not an actual missing execution.
- Every retry of a POST request needs a new
x-ratio-request-id and therefore a new HMAC signature.