let params = {
   inTokenAddress: '0x9029FdFAe9A03135846381c7cE16595C3554e10A',
   outTokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
   amount: 5,
   gasPrice: 1,
   };
 async quote(){
  const { data } = await axios.get('https://api.0xgen.io/v1/bsc/quote', {params})
 }
And your response will look like this:
{
 "code": 200,
 "data": {
   "dexes": [
     {
       "name": "openOcean",
       "amount": "1614773503060146858429"
     },
     {
       "name": "1inch",
       "amount": "1614222924617714762008"
     }
   ],
   "maxOutAmount": "1614773503060146858429",
   "minOutAmount": "1614222924617714762008",
   "inToken": {
     "symbol": "BNB",
     "name": "Binance Coin",
     "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
     "decimals": 18
   },
   "outToken": {
     "symbol": "1INCH",
     "name": "1INCH Token",
     "address": "0x111111111117dc0aa78b770fa6a738034120c302",
     "decimals": 18
   },
   "inAmount": "5000000000000000000"
 }
}
Step 3: Obtain on-chain transaction data.
You can obtain the on-chain transaction data from a specified platform.
For example, you want to use openocean to obtain the on-chain transaction data;
{
 let params = {
   inTokenAddress: '0x9029FdFAe9A03135846381c7cE16595C3554e10A',
   outTokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
   amount: 5,
   gasPrice: 1,
   slippage:100,
   account: ''// wallet address
   };
 const res = await axios.get('https://api.0xgen.io/v1/bsc/openOcean/swap_quote', {params})
}
response:
If you call it right, you will get a result like this:
{
 "code": 200,
 "data": {
   "inToken": {
     "symbol": "BNB",
     "name": "Binance Coin",
     "address": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
     "decimals": 18
   },
   "outToken": {
     "symbol": "USDT",
     "name": "Binance-Peg USD (T)",
     "decimals": 18,
     "address": "0x55d398326f99059ff775485246999027b3197955"
   },
   "inAmount": "5000000000000000",
   "outAmount": "1533988843342961506",
   "estimatedGas": "198245",
   "minOutAmount": "1518648954909531891",
   "from": "0x929B44e589AC4dD99c0282614e9a844Ea9483C69",
   "to": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64",
   "value": "5000000000000000",
   "gasPrice": "5000000000",
   "data": ""
 }
 }
sendTransaction
Here is a case for you to make a transaction on BNB Chain.
import { ethers } from "ethers";
import axios from "axios";
async function swap() {
 const account = ''; // wallet address;
 const private_key = ''; //private key;
 const provider = new ethers.providers.JsonRpcProvider('');
 const wallet = new ethers.Wallet(private_key, provider);
 let params = {
   inTokenAddress: '0x9029FdFAe9A03135846381c7cE16595C3554e10A',
   outTokenAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
   amount: 5,
   gasPrice: 1,
   slippage: 100,
   account// wallet address
 };
 const res = await axios.get("https://api.0xgen.io/v1/bsc/openOcean/swap_quote", { params });
 if (res) {
​
   const { estimatedGas, data, gasPrice } = res.data.data;
   const swapParams = {
     from: '', // wallet address
     to: '0x6352a56caadc4f1e25cd6c75970fa768a3304e64', //Please use the contract from the contract page
     gas: estimatedGas,
     gasPrice: gasPrice,
     data
   };
​
   if (isNativeToken(params.inTokenAddress.toLowerCase())) {
     swapParams.value = ethers.BigNumber.from(res.data.value);
   }
​
   const { hash } = await wallet.sendTransaction(swapParams)
 } else {
   return
 }
}