Swap and Gasless APIs support multiple blockchain networks. Refer to the Supported Chains page for the full list of currently supported networks and chain IDs.
See full list of required query parameters and responses here.
See full list of required query parameters and responses here.
This section provides an overview of the three main contracts developers need to understand when working with the 0x API - AllowanceHolder, Permit2, 0x Settler. For more in-depth details, refer to the 0x Contracts section.
NEVER set an allowance on the Settler contract. Doing so may result in unintended consequences, including potential loss of tokens or exposure to security risks. The Settler contract does not support or require token allowances for its operation. Setting an allowance on the Settler contract will lead to misuse by other parties.
ONLY set allowances on AllowanceHolder or Permit2 contracts, as indicated by the API responses.
The correct allowance target is returned in issues.allowance.spender or allowanceTarget.
The 0x Settler contract is the core execution layer of 0x v2, designed for flexibility and security. It is responsible for executing swaps without requiring passive token allowances.
⚠️ Important: Never set token allowances directly on the Settler contract — this will result in lost funds.
Key Points:
/swap/permit2, Settler is the entry point contract (where you send data).transaction.to by the API.Further reading: 0x Settler
AllowanceHolder is the default and recommended allowance contract for most integrators. It provides a better UX, lower gas costs, and is designed to minimize common integration pitfalls that can occur with using Permit2.
Why use AllowanceHolder?
AllowanceHolder is recommended for most integrators, and it is especially well-suited for:
Endpoints:
Key Points:
issues.allowance.spender or allowanceTarget.0x0000000000001fF3684f28c67538d4D072C22734 — Cancun hardfork chains (Ethereum Mainnet, Arbitrum, Avalanche, Base, Berachain, Blast, BSC, Ink, Linea, Mode, Monad, Optimism, Plasma, Polygon, Scroll, Sonic, Unichain, World Chain)0x0000000000005E88410CcDFaDe4a5EfaE4b49562 — Shanghai hardfork chains (Mantle)Further Reading: AllowanceHolder Contract
Permit2, developed by Uniswap, enables flexible approvals with features like time-limited and granular allowances. It can be powerful, but it introduces risks that new integrators must be careful with
⚠️ Permit2 is for advanced integrators only.
If you use Permit2, ONLY set allowances on Permit2. NEVER set an allowance on the Settler contract. Setting an allowance on Settler WILL result in loss of funds.
When to use Permit2:
Endpoints:
Key Points:
issues.allowance.spender or allowanceTarget.0x000000000022D473030F116dDEE9F6B43aC78BA3 across all chains. You can hardcode this address in your integration.Further Reading: Permit2