Multi-Fee Support
The Swap and Gasless APIs support collecting fees for multiple recipients in a single transaction. This is useful for use cases like revenue sharing between a protocol and a frontend, splitting fees between partners, or distributing fees across multiple treasury addresses — all without requiring multiple transactions or custom contracts.
Overview
Fee splitting is controlled by three query parameters that work together:
swapFeeRecipient— one or more wallet addresses (comma-separated) that receive fees at settlementswapFeeBps— one or more fee amounts in basis points (comma-separated), defining how much each recipient earnsswapFeeToken(optional) — the token fees are collected in; can be omitted or set to either the address ofbuyTokenorsellToken
swapFeeRecipient and swapFeeBps are positionally matched and co-dependent. The first value in swapFeeBps applies to the first address in swapFeeRecipient, the second to the second, and so on. Both must be present and the same length.
Use swapFeeToken to specify which token fees are collected in — either the buyToken or sellToken. If omitted, 0x defaults to the buy token, unless the sell token has higher priority (e.g., stablecoins or a more liquid asset) or the buy token is ineligible.
Parameters
The wallet address(es) to receive trading fees. Accepts a single address or multiple comma-separated addresses.
Example: 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045,0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359
When providing multiple values, the list must be the same length as swapFeeBps. You must also specify swapFeeBps to use this parameter.
The fee amount(s) in basis points (Bps) to charge per recipient. Accepts a single value or multiple comma-separated values.
Example: 5,10
When providing multiple values, the list must be the same length as swapFeeRecipient. The default maximum is 1000 Bps per recipient. Contact us if your integration requires a higher limit.
The contract address of the token to collect trading fees in. Accepts a single address or multiple comma-separated addresses.
Format: ^\s*0x(?!0{40})[a-fA-F0-9]{40}(\s*,\s*0x(?!0{40})[a-fA-F0-9]{40})*\s*$
Each value must be set to either the address of the buyToken or the sellToken. When multiple values are provided, the list must be the same length as swapFeeBps.
If omitted, 0x selects the fee token from the trade. The buy token is used by default unless the sell token has higher priority (e.g., stablecoins or more liquid assets) or the buy token is ineligible.
You must also specify swapFeeRecipient and swapFeeBps to use this parameter.
swapFeeRecipient and swapFeeBps are co-dependent — you must specify both
together. When using multiple fees, both lists must be the same length and
positionally matched (index 0 of swapFeeBps applies to index 0 of
swapFeeRecipient, and so on). swapFeeToken must also match this length
when multiple values are provided.
Example Request
The following example splits fees between two recipients on a USDC → USDT swap — 5 Bps to the platform and 10 Bps to a distribution partner. swapFeeToken is omitted, so fees default to the buy token (USDT).
Example Response
When multiple fees are configured, the response includes both the legacy integratorFee field (containing the first fee, for backwards compatibility) and the new integratorFees array (containing all fees):
fees.integratorFee is retained for backwards compatibility and always
reflects the first fee in the list. Use fees.integratorFees to access
the full breakdown of all fees.
Each entry in integratorFees corresponds positionally to the swapFeeRecipient and swapFeeBps values in your request: