Skip to main content
The API uses HTTP status codes plus a JSON body of the form { "error": "<message>" } for every error. This guide covers what each status code means and the right response.

Status code reference

Common error messages

Treatment: show the user a clear message (“This pair has no liquidity right now”), do not retry. If 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 a submit response and broadcast the transaction, a separate class of failures can happen on-chain:
The on-chain Slippage revert is intentional. It means the safety net worked. If a user complains, the most common fix is “use slightly higher slippage” or “re-quote and retry quickly.”
Then in the submit handler:

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.