Errors
Error responses use plain-text bodies, not JSON. Check the HTTP status code first, then read the response body.
Status codes
400Bad RequestA required parameter is missing or has an invalid format (e.g., non-hex address, non-numeric amount). The response body is a plain-text string describing the specific problem.
404Not FoundThe requested chain_id is not supported. Returns an nginx 404 HTML page.
500Server ErrorUnexpected server error.
Example 400 bodies
amount must be provided
amount must be a base-10 integer
src and dst must be valid 0x... addressesNote:
The swap endpoint always returns 200 even when no route is found — check that toAmount is
non-zero and tx is present before submitting. See Get Swap Route.