DEV Community

Cover image for Bybit Bot API: Set Up a Trade-Only Key Safely
Bot LAB
Bot LAB

Posted on Originally published at botlab.org.uk

Bybit Bot API: Set Up a Trade-Only Key Safely

For a Bybit bot API, create a dedicated key with trading permission only, withdrawals off, and an IP restriction, ideally on a separate sub-account with a small balance. Then test the bot on paper or testnet first, because a safe key protects your funds from theft but does nothing to protect you from a bad strategy.

This guide covers both halves: how to set up the key, and how to judge the bot behind it.

What a Bybit bot API key actually does

An API key lets software act on your exchange account without your password. Each key carries permissions, and the bot can only do what those permissions allow.

A trading bot needs to read balances and positions, place orders, and cancel orders. It does not need to move money out of your account. If a key cannot withdraw, then even a leaked key cannot send your funds to someone else's address. It can still place bad trades, which is why the key is only half of the safety picture.

Exchanges change their menus and labels from time to time, so check Bybit's current API documentation for the exact wording. The principles below stay the same.

The Bybit bot API key checklist

1. Use a separate sub-account

Create a sub-account just for the bot and move only the capital you are prepared to lose into it. If something goes wrong, the damage stops at that balance. Your main account, your long-term holdings and your other strategies stay out of reach.

2. Grant trading permission only

When you create the key, enable only what the bot needs:

  • Read access for balances and positions
  • Order and position permission for the product it trades (spot or derivatives)

Leave everything wallet-related off: withdrawals, transfers and anything that moves assets. If a bot's setup guide says it needs withdrawal permission, that is a red flag. Do not proceed.

3. Restrict the key to an IP address

IP restriction means the key only works when requests come from addresses you list. If the key leaks, it is useless from anywhere else. If the bot runs on a server, use that server's fixed IP. If you run it from home, remember that home IPs can change.

Keys without an IP restriction may be limited or expire sooner on some exchanges, so check Bybit's current rules.

4. Never share the secret

Treat the API secret like a password:

  • Do not paste it into chats, forms or screenshots.
  • Do not give it to anyone who messages you offering to "manage" or "optimise" your account.
  • Never share your account password, 2FA codes or seed phrases with any bot or service. A legitimate bot never needs them.

5. Plan for revoking it

Know where the key is listed in your account and how to delete it. If the bot misbehaves, you delete the key and the bot stops. Do this as a drill once before you go live, so it is not the first time during a bad day.

Safe key, unsafe strategy

The main risk with a bot is no longer theft once the key is locked down. It is the strategy itself. A bot can follow its rules perfectly and still lose money, because the rules never had an edge, or the edge disappeared after fees, or the backtest was overfit.

Illustration: how leverage turns a small move into a big loss

This is a made-up example with simple numbers. It is not a BOTLAB result and not a forecast.

Say a bot account holds 500 USDT. The bot opens 5 positions, each using 100 USDT of margin at x10 leverage. Each position then has 1,000 USDT of notional exposure.

  • If one coin moves 1% against a position, that position loses about 10 USDT. That is 10% of its margin and 2% of the account.
  • Crypto coins often move together. If all 5 positions move 1% against the bot at once, the loss is about 50 USDT, or 10% of the account.
  • A 5% move against all five at once would be about 250 USDT, or half the account, before counting fees and funding, and liquidation can trigger before that on thinner margins.

None of this requires a hacked key or a broken bot. It is just the arithmetic of leverage and correlation. That is why the leverage setting and the number of simultaneous positions matter as much as the API permissions. Lower leverage gives you more room, but it does not remove the risk.

How to test the bot before it uses real money

Step 1: Backtest with costs included

A backtest replays a strategy on past data. Make sure it includes trading fees, slippage and funding costs on perpetual futures. Many bots that look good with zero costs lose money once real fees are applied. For a deeper walkthrough, see Crypto Trading Bot Backtesting: An Honest How-To Guide.

Step 2: Check the sample size

A strategy with 20 trades tells you very little. A lucky streak can look like skill. Read How Many Trades Does a Backtest Need? before you trust any result.

Step 3: Forward test on paper or testnet

A backtest only shows the past. Forward testing runs the strategy on live prices with simulated money, so it cannot peek at the future. Bybit offers a testnet, and many tools offer paper trading. Our guide Paper Trading Crypto Futures: How to Make It Honest covers how to avoid fooling yourself.

Paper trading has limits: it can understate slippage and cannot reproduce how your own orders move the market. Treat it as a filter that removes obviously bad ideas, not as proof of future results.

Step 4: Go small and set a loss limit

If a bot passes testing, start with an amount that would not hurt you to lose entirely. Decide your maximum acceptable drawdown before you start, and stop the bot if it is hit. Deciding in advance matters, because deciding during a losing streak is much harder.

How BOTLAB judges bots

At BOTLAB we run bots on paper and judge them against 6 statistical gates (G1–G6), defined on the site. A bot is only labelled "ready for micro live" after passing all six. As of 27 Nov 2026, none of the 285 bots we track has reached that status. We list 5 as WATCH and 280 as NOT_READY.

For a sense of what a partial pass looks like, one paper-trading bot, mr4h/long, logged 249 simulated trades over 102 days (16 Aug to 26 Nov 2026) with a 63.9% win rate. It passed 4 of 6 gates and is labelled WATCH, with the verdict "sample too small to conclude". These are simulated results, not real trading, and past results don't predict future results.

You can see how every tracked bot is rated, with its trade count and period, on the BOTLAB platform.

Red flags in any Bybit bot offer

  • It asks for withdrawal permission, your password, a 2FA code or a seed phrase.
  • It promises fixed returns or says "guaranteed" or "risk-free".
  • It shows only a win rate, with no trade count, period or drawdown.
  • It will not say whether its results are live or simulated.
  • It pressures you with countdowns or "only a few spots left".

Also check the legal side. Exchange and bot services are not available everywhere, so confirm that both Bybit and any bot provider operate in your country before you sign up.

FAQ

What permissions does a Bybit trading bot need?

Usually just read access plus order and position permission for the product it trades. Withdrawals and asset transfers should stay off. If a bot demands more than that, ask why, and walk away if the answer is not convincing.

Is it safe to give a bot my Bybit API key?

It is safer than sharing a password, if the key is trade-only, IP-restricted and on a sub-account with limited funds. It is never completely risk-free: the bot can still lose money through its trades, and a poorly secured server can leak the key. Only use software from providers you can verify, and keep the balance small.

Can a trade-only API key still lose me money?

Yes. A trade-only key cannot withdraw funds, but the bot can open losing trades, use leverage, and be liquidated. The key protects against theft, not against a weak strategy.

Should I use Bybit testnet or paper trading first?

Yes, test first. Testnet or paper trading lets you check that orders, stop-losses and position limits behave as expected without risking capital. Just remember that simulated fills are cleaner than real ones, so results will usually look better than live trading would.

Key takeaways

  • Create a dedicated key with trading permission only, withdrawals off, and an IP restriction.
  • Use a sub-account with only the capital you can afford to lose.
  • Never share passwords, 2FA codes, seed phrases or the API secret.
  • A safe key protects against theft, not against a bad strategy or leverage losses.
  • Backtest with costs, check the trade count, then forward test before going live.
  • Start small, set a maximum loss in advance, and know how to revoke the key quickly.

Paper trading results are simulated. Past results don't predict future results. Crypto trading can lose money, including all capital. Not financial advice. Not available in restricted jurisdictions (see the Service Agreement). You trade with your own exchange account; BOTLAB never holds funds.

Want these checks run on your own strategy? See the strategy and backtest audit.


Originally published on BOTLAB. Score your own bot's trade log free: Check your bot.

Top comments (0)