> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> Error codes and responses returned by the swap API when requests cannot be fulfilled

The swap APIs return the following errors when a request cannot be fulfilled.

## Validation errors

| Error | HTTP status | Description |
| - | - | - |
| Swaps not enabled | 403 | Swaps are not enabled for your app. [Enable swaps](/wallets/actions/swap/setup) in the Privy Dashboard. |
| Unsupported chain | 400 | The `caip2` chain identifier is not a [supported chain](/wallets/actions/swap/overview#supported-chains). |
| Same input and output token | 400 | The `input_token` and `output_token` must be different. |
| Unsupported wallet type | 400 | The wallet type is not supported for swap operations. Swaps are available for EVM and Solana wallets. |
| Insufficient token balance | 400 | The wallet does not have enough of the input token to cover the swap amount. Returned for `exact_input` swaps only. |

## Routing errors

| Error | HTTP status | Description |
| - | - | - |
| No quotes available | 400 | No swap route could be found for the given token pair, amount, or chain. This can occur if the token pair lacks liquidity or the token address is invalid on the specified chain. |
| Token or route not found | 404 | The specified token or swap route does not exist. Verify that the token addresses are correct for the target chain. |
| Rate limited | 429 | The request was rate limited. Retry after a brief delay. |

## Execution errors

A swap that passes validation is accepted as a [wallet action](/wallets/actions/overview) and
executed asynchronously. The following conditions are not returned on the request — they surface as a
`rejected` wallet action, before anything is submitted on-chain. Poll the wallet action or subscribe
to the [`swap.rejected` webhook](/api-reference/webhooks/wallet-action/swap/rejected) to detect them.

| Error | Description |
| - | - |
| Gas sponsorship not enabled | The swap was prepared as sponsored, but [gas sponsorship](/wallets/actions/swap/setup#2-configure-fee-sponsorship) was no longer enabled for the app when the swap reached execution. |
| Insufficient gas credits | Gas sponsorship is enabled but the app's gas credit balance cannot cover the network fee. Fund the credit balance or add a payment method in the Dashboard. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.