An exchange API key is a credential the exchange issues so software can act on the account within the permissions you tick. It is not your login password.
Giving that key to a bot is safe only when the permissions are narrow. The bot needs to read the account and to place or cancel perpetual futures orders. It does not need to withdraw, and it does not need to transfer funds between wallets. The exchange still holds the funds. A stolen key with withdrawal enabled is a withdrawal. A stolen key with withdrawal off and an IP whitelist can still place orders, which is a real loss, and it cannot send the balance to another address.
The account path, including the key step, is on Get started. Leveraged futures carry a high risk of loss. A careful key does not change the market.