{ "error": "<message>" } for every error. This guide covers what each status code means and the right response.
Status code reference
Common error messages
- 400 examples
- 401 example
- 404 example (only on /submit)
- 429 example
- 5xx (internal)
no routes for pair happens often for a specific token, the token may not have routable on-chain liquidity on Base.On-chain transaction failures
Errors above are HTTP errors. Once you have asubmit response and broadcast the transaction, a separate class of failures can happen on-chain:
Recommended retry policy
What NOT to do
Don't retry 400 errors
400 means the request itself is malformed or unroutable. Retrying doesn’t help; fix the request.Don't hammer on 429
The rate limit window is per API key. Retrying immediately after a
429 makes the situation worse and burns the rest of your minute. Always back off.Don't surface raw errors to users
Translate
error strings into UI-friendly copy. “no routes for pair” → “Couldn’t find liquidity for this pair, try a different amount or token.”Don't ignore on-chain reverts
Always check
receipt.status === "success" after waitForTransactionReceipt. A 0x tx hash is not the same as a successful swap.