Withdrawl error using API.

Hello, nice to meet you.
I wrote the code like below to withdraw money using API.

async function withdrawToken(address, amount) {
try {
// Call the Binance API using rawRequest
const response = await client.withdraw({coin: “USDT”, network: “ETH”, address: address, amount: amount});
console.log(‘Withdrawal response:’, response);
return response;
} catch (error) {
console.error(‘Error withdrawing USDT:’, error.response?.data || error.message);
throw error;
}
}

I got this error.
Error withdrawing USDT: Please note that withdrawals through SAPI are not permitted. To facilitate the withdrawal process, please use the official Binance website or mobile application.

I don’t know how the other people withdraw tokens from the binance using api.
I already check the “withdraw” using api already.

What’s the problem?
Best regards.

Hey,
Are you trying to withdraw assets from Main account or Sub-account? It will not work if you are trying from a Sub-account.
If you continue to encounter this issue, please contact the Customer Support team for further assistance: Binance Chat