thirdweb API: Bridge Swap Endpoint
thirdweb API v1.6

We've deprecated the /payments/swap
and /tokens/swap
endpoints in favor of the /bridge/swap
endpoint. This endpoint behaves the same as the pre-existing swap endpoints, allowing you to perform cross-chain swaps with both input and output-centric amounts. To learn more, see the thirdweb API reference.
curl -sS -X POST "https://api.thirdweb.com/v1/bridge/swap" \
-H "Content-Type: application/json" \
-H "x-secret-key: <YOUR_SECRET_KEY>" \
-d '{
"from": "0xYOUR_WALLET",
"exact": "input",
"tokenIn": { "address": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", "chainId": 42161, "amount": "1000000" },
"tokenOut": { "address": "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", "chainId": 42161, "minAmount": "990000" }
}'