Security

Bybit API Key Security: Complete Guide — Disable Withdraw, IP Allowlist, Sub-Accounts

2026-08-12·12 min read

You're about to wire a TradingView signal or a trading bot into Bybit for automated execution, and the first thing you have to do is generate an API key — the credential your software uses to talk to the exchange on your behalf. Most people over-grant permissions at this step, because Bybit's permission checkboxes are more granular than Binance's, and the field names — ContractTrade, Wallet — don't map to anything obvious. It's very easy to click through and accidentally include Withdraw. This guide walks through the parts of Bybit's official V5 API docs that actually change your risk exposure, cross-checked against our own API-key permission checklist across 10 exchanges, and focuses on the three settings that matter.

This isn't a comparison of whose security posture is stronger across exchanges — that requires cross-exchange penetration testing and internal audits, we haven't done that work, and this article won't pretend to. The scope is a single API-key layer, because if you get this layer right the money is safe even when a downstream tool gets compromised; get it wrong and everything else you do is decoration.

The short version
Three things, in order of importance: when you create the key, do not tick Withdraw under Wallet; put the bot's key inside a sub-account — because Bybit's own docs mark Withdraw as "master account only" at the API level, so a sub-account key structurally cannot hold that permission; and add whatever IPs the tool gives you to the IP allowlist — Bybit lets you comma-separate multiple IPs. That last one matters more on Bybit than most people realise, because the official API docs say verbatim "No ip bound api key will be invalid after 90 days" — a key without an IP binding expires after 90 days.

The First Thing to Understand: The Permission Model (Two Keys, UTA Is Default)

Bybit V5 API authentication uses only two credentials — ACCESS-KEY plus Secret Key, sent as HTTP headers X-BAPI-API-KEY and X-BAPI-SIGN. That's different from Bitget and OKX, which require a third Passphrase, and matches Binance/BingX.

Fewer credentials means one less thing to hide. It also means that if those two leak, an attacker has everything needed to sign requests — there's no third factor left to save you.

Starting from V5, Bybit merged Spot, Derivatives and Options into a "Unified Trading Account" (UTA), and every newly-registered account defaults to UTA mode. The API-layer consequence is that a single key can carry ContractTrade, Spot, Options and Derivatives permissions simultaneously — one key can run three product lines.

Permission groupOfficial field valueDoes an automated bot need it?
Read-OnlyreadOnly=1Set readOnly=1 for market-data or position reads; readOnly=0 is required to place orders
ContractTrade (perpetuals)Order, PositionRequired for any futures strategy — order, cancel, modify position
SpotSpotTradeTick this for spot strategies
Options (USDC options / perpetuals)OptionsTradeOnly for options strategies, otherwise skip
Derivatives (UTA unified)DerivativesTradeThe unified-derivatives field for UTA accounts
Wallet.AccountTransferAccountTransferMost bots don't need it — unless the strategy moves funds around on its own
Wallet.WithdrawWithdraw (master-only)Never tick this — the docs explicitly state sub-account keys cannot even have this field
ExchangeExchangeHistoryReads convert history, rarely needed

Source: Bybit V5 apikey-info docs (verified August 2026) and our cross-exchange permission checklist. UI labels will shift as Bybit updates the frontend.

Bybit's key-creation UI gives you two options: System-generated or Auto-generated.

System-generated (HMAC)Auto-generated (RSA)
Who produces the secretBybit generates a pair for youYou generate one locally with api-rsa-generator
Does Bybit hold your private keyYes (HMAC is a shared secret)No — you only upload the public key
Downstream tool supportAlmost every tool supports itOlder tools may not accept RSA_SHA256
Best fitBeginners, SaaS usersRSA-savvy operators, self-hosted setups, maximum-paranoia users

The RSA path's upside is "Bybit never holds your private key" — even if Bybit's side is breached, your secret doesn't leak. The downside is extra setup time, and your downstream tool must support RSA signing. If you use a SaaS trading bot, ask the vendor whether they support RSA first; in most situations HMAC is enough.

Three Mandatory Settings: Kill Withdraw, Bind IP, Use a Sub-Account

Setting 1: Don't tick Withdraw under Wallet

This one matters because it decides how bad a leak gets. The other two decide how likely a leak is.

No matter how tight your IP allowlist is, no matter how carefully you hide the Secret Key, the key can still leak — malware, a compromised SaaS vendor, a stray push to a public repo. Whether Withdraw is ticked decides whether the attacker can walk out with the money.

Bybit separates trading and withdrawal cleanly at the key level, which we already verified in our cross-exchange permission checklist — Bybit is one of the 9 exchanges where they can be separated. So this is not a technical limitation — it comes down to whether you remember not to tick the box.

Bybit's official V5 API docs label the Wallet.Withdraw field as "Withdraw(master account)" — the field only exists for master accounts. A sub-account key literally does not have that checkbox.

What actually happens when Withdraw is left on: funds are gone in minutes
Suppose your key carries ContractTrade, Spot and Withdraw, and it leaks. The attacker's first move isn't to lose your money. It's to market-sell every asset into USDT and then call /v5/asset/withdraw/create to their own address. The whole thing can take a few minutes.

The "worst case is a few dumb trades" mental model most people hold is not the real worst case. The real path is what we just described: convert first, withdraw second.

Whether IP allowlisting saves you depends on whether the attacker can hit the API from the IPs you set. Plenty of leak scenarios — for example, pushing a config file that contains the IP — leak the IP information alongside the key.

Setting 2: Bind an IP allowlist — Bybit accepts multiple, comma-separated

Bybit's V5 API docs describe the IP field on create-sub-api as "Set the IP bind. example: 192.168.0.1,192.168.0.2. don't pass ips or pass with * means no bind" — multiple IPs separated by half-width commas.

This is handy for SaaS tools, which usually give you 2–3 fixed egress IPs. A self-hosted VPS typically has one fixed IP. On the SaaS side you get fixed egress IPs — TVSBot's dashboard displays the backend IPs you need to paste into Bybit.

Numbers vary by tool — ask before integrating. Tools with dynamic egress IPs can't be locked down with an IP allowlist, and you have to decide whether that trade-off is acceptable.

Setting 3: Put the bot's key in a sub-account — Bybit removes Withdraw at the architecture level

This is the biggest difference from the Binance version of this guide, and the most decisive thing Bybit does at the API-architecture level — the docs state plainly that a sub-account key's Wallet permission "can only be AccountTransfer and SubMemberTransferList". In other words, a sub-account key cannot be ticked for Withdraw even if you wanted to. This deserves its own H2.

Sub-Account Isolation: Bybit Locks Withdraw Out at the API Layer

In the Bybit V5 API docs' create-sub-api (create sub-account API key) chapter, the official definition of the Wallet field in the permissions object reads "Wallet. ["AccountTransfer","SubMemberTransferList"]" — those are the only two valid values, and Withdraw is not one of them.

The same doc's apikey-info endpoint (query key info) defines the full Wallet set as "AccountTransfer, SubMemberTransfer(master account), SubMemberTransferList(sub account), Withdraw(master account)" — Withdraw is explicitly master-account only.

Locked at API
Sub-account API keys cannot hold Withdraw (Bybit V5 docs, verbatim)
90 days
Official expiry for keys with no IP binding (looser than Binance 30, BingX 14)
7 days
Additional expiry countdown after an account password change
2
Number of credentials required for auth (Key + Secret, no Passphrase)

The practical meaning: even if your sub-account key is fully compromised, the attacker has no direct path to withdraw.

The worst they can do is place bad orders or market-sell the sub-account balance into other assets, but they cannot call Bybit's withdraw endpoint — the API rejects it outright due to insufficient permissions. On Binance you rely on your own memory to not tick a box; on Bybit the API architecture enforces it.

When is a sub-account worth setting up
A simple rule — if the funds the bot manages exceed the amount you can afford to lose in one shot, isolate them in a sub-account.

Example: your master account holds 100,000 USDT and the bot only runs a 5,000 USDT strategy — move that 5,000 into an isolated sub-account, and the worst case is a 5% loss instead of everything. This principle isn't Bybit-specific, it applies to any multi-asset account setup.

What's Bybit-specific is that the API architecture removes the withdrawal path from sub-accounts entirely — the common "forgot to untick" mistake is blocked for you at the platform level.

1
Does the money you run through a bot on Bybit exceed what you can afford to lose in one hit?
NoCreate a key directly on the master account, skip Withdraw, bind an IP. That's enough.
YesGo to the next question.
2
Does the master account need to auto-transfer margin top-ups to the bot?
NoCreate a sub-account, move the funds over once, create the key inside the sub-account (the Withdraw option isn't even shown).
YesCreate a sub-account, keep an AccountTransfer-only key on the master for the transfer job, and keep the bot's trading key inside the sub-account.
BinanceBitgetBybit
Can a sub-account key hold WithdrawYes (up to you to not tick it)Yes (up to you to not tick it)No — removed at the API level
How to create a sub-account keyMaster account creates itSub-account creates its own (master must enable it)Master API call or sub-account login
Credentials needed for auth2 (Key + Secret)3 (Key + Secret + Passphrase)2 (Key + Secret)
Expiry for keys with no IP bindingDeleted after 30 idle daysNot stated in official docsInvalid after 90 days; 7 days after a password change

This table isn't here to declare Bybit the winner — each exchange has its own logic. Bybit's architectural block on sub-account withdraw is especially forgiving for people who forget or don't know the permission model well. Bitget's "sub-accounts manage their own API" freedom is more useful for teams running different strategies. Binance's master-managed approach is simpler for a single person running a single bot. Pick based on your actual situation.

The 90-Day Expiry Rule: Bybit Has It in Writing, Just Looser Than Binance/BingX

The Bybit V5 API docs' create-sub-api chapter, under the ips field, says verbatim: "No ip bound api key will be invalid after 90 days" — a key without an IP binding expires after 90 days.

The same section adds: "api key without IP bound will be invalid after 7 days once the account password is changed" — even a freshly-created key expires 7 days after you change your password if it has no IP binding.

The apikey-info response includes deadlineDay (days remaining) and expiredAt (expiry timestamp), both of which are only populated when the key has no IP binding or the password was changed.

What the difference from Binance/BingX actually means in practice
All three enforce mandatory expiry on unbound-IP keys, just at different intervals — Binance 30 days, BingX 14 days, Bybit 90 days.

Bybit's 90 days is the loosest, which means if you plug into Bybit and forget to bind an IP, the bot won't go dark quickly — but it's running exposed for those three months. Conversely, if you did bind an IP, this rule doesn't apply at all and the key stays alive indefinitely.

Verified August 2026, and this article goes stale if Bybit changes the rule. A safer default is to not rely on the exchange's expiry mechanism and to rotate the key manually every 6 months — regardless of whether the exchange helps you, put it on your own schedule.

The Actual Flow for Creating a Bybit API Key

Bybit's UI shifts every so often, so this guide won't hard-code pixel-level button positions — just the step skeleton you have to hit. Assuming you're taking the "bot inside a sub-account" path, the flow is two steps longer than a straight master-account key, but you only do it once and it's stable afterwards.

text
[Prerequisite: no key creation in the first 48 hours of a new account]
        0. Bybit risk-control rule: newly-registered accounts cannot create API keys
           for the first 48 hours (stated in the help center, lifts automatically)

        [First-time setup: create the sub-account]
        1. Log into Bybit -> avatar top-right -> Sub-Accounts
        2. Create Sub-Account -> pick a sub-account username (6-16 chars, alphanumeric)
        3. memberType = normal subaccount (do NOT pick custodial)
        4. Universal Transfer the funds the bot will use from master to sub-account

        [Key creation: two paths, pick one]
        Path A: log into the sub-account directly and create the key
        5A. Log in as the sub-account -> avatar -> API -> Create New Key
        6A. Pick System-generated API Keys (beginners take this, HMAC)
        7A. Set a note (e.g. tvsbot-prod, grid-bot-01)
        8A. Tick Contract Trade or Spot Trading (depending on your strategy)
        9A. Do NOT tick Withdrawal (the sub-account UI won't even offer it)
        10A. Fill the IP allowlist (multiple IPs, half-width comma separated)
        11A. Pass 2FA -> receive API Key + Secret (Secret is shown ONCE, copy it now)

        Path B: call /v5/user/create-sub-api with a master key
        5B. Use this for automated key provisioning across many sub-accounts
        6B. The permissions object must NOT include Withdraw - Bybit will reject it
        7B. Include an ips array and a note; response returns apiKey + secret directly

The Secret Key is shown exactly once — a rule every exchange shares. Bybit doesn't use a Passphrase, so once you have the API Key and Secret strings safely stored you're done.

Any password manager works — 1Password, Bitwarden, macOS Keychain. Pasting into plain text files, Slack or email is a bad habit that hurts once per lapse.

How to Pick an Automation Tool That Talks to Bybit

Bybit is one of the exchanges we tag as "has an official REST/WebSocket API, can accept automated orders" in our TradingView webhook support by exchange roundup — which means many tools claim to integrate. When choosing one, ask three things:

  • Does it require Withdraw permission on the key? If yes, skip this tool — placing spot or futures orders never needs withdraw permission at the API level; asking for it is an architecture red flag.
  • How many fixed IPs does it give you? Most SaaS platforms have 1–3; Bybit accepts them comma-separated, all of them fit. Tools with dynamic egress IPs simply can't be locked with an IP allowlist.
  • How is your Secret Key stored on their side? Plaintext database storage is a red flag. Encrypted at rest, with the master encryption key stored separately from the database, is the baseline worth asking about.

For what it's worth: TVSBot encrypts your API Key and Secret with Fernet (AES-128-CBC + HMAC-SHA256), keeping the master encryption key in an environment variable — physically separated from the database itself.

Every order call goes directly against Bybit's V5 API using your own key. We never hold your funds. The dashboard displays the backend IPs you paste into Bybit's allowlist, and the setup docs recommend ticking only Contract Trade + Spot Trading, with Withdrawal left off.

The same checklist applies to any non-custodial tool, not just TVSBot — so if you end up choosing another vendor, this section still holds up.

The Honest Section: What This Guide Doesn't Fix

Even with all three settings dialled in correctly, there are risks this guide cannot eliminate, and it's here so your expectations line up with reality:

First, an exchange being compromised itself has no API-key-level defence — money on Bybit is exposed to Bybit's platform-operations risk. That layer is handled by the exchange's Proof of Reserves, insurance fund, and by you spreading holdings across multiple venues or cold wallets — nothing to do with how you set up keys.

Second, your own strategy losing money has nothing to do with API-key security. This guide doesn't cover strategy risk at all. Even the most conservative grid bot or funding-rate arbitrage loses in extreme conditions. For strategy-level risk sizing, see Kelly criterion and position sizing and ATR-based dynamic position sizing.

Third, we haven't audited Bybit's internal controls. Everything in this article about official Bybit rules is drawn from the publicly-verifiable V5 API docs and help center, as of August 2026. Exchange policies change with little notice — before actually configuring anything, go verify the current rules on Bybit's official API docs page.

Two environmental restrictions Bybit will reject you for
Bybit's V5 Integration Guidance chapter states "IP addresses located in the US or Mainland China are restricted and will return a 403 Forbidden error" — if your bot's VPS is in either region, the API won't connect at all, and this isn't a key-setup problem you can fix. Newly-registered accounts also can't create API keys for the first 48 hours.

FAQ

Why doesn't Bybit's API need a Passphrase? What's the difference from Bitget and OKX?

Bybit V5 authentication needs two credentials: ACCESS-KEY (API Key) plus X-BAPI-SIGN derived from the Secret Key. Bitget and OKX chose to require a third Passphrase; Bybit didn't take that path.

In practice, that's one less thing to hide, but also one less layer of defence — if both credentials leak, the attacker can sign requests. Handle the Secret more carefully; keep it out of plain text files and chat windows.

Do I have to use a sub-account? Can't I just create the key on the master account?

Technically yes, Bybit doesn't force it. But if the funds the bot manages exceed the amount you can afford to lose in one shot, sub-account isolation is worth doing.

The Bybit V5 API docs explicitly state a sub-account key's Wallet permission is "["AccountTransfer","SubMemberTransferList"]", with no Withdraw option — the withdrawal path is architecturally locked. The same effect on Binance/Bitget depends on your memory to not tick a box; Bybit codes it into the API.

Does the Bybit key auto-expire? How often should I rotate?

Bybit V5 docs, verbatim: "No ip bound api key will be invalid after 90 days" — a key with no IP binding expires after 90 days.

And: "api key without IP bound will be invalid after 7 days once the account password is changed" — 7 more days after a password change. Keys with IP binding are exempt and stay alive indefinitely.

Put a "rotate every 6 months" reminder in your own schedule — regardless of what the exchange does, do it yourself.

System-generated vs Auto-generated keys — which do I pick?

System-generated means Bybit generates an HMAC key pair for you — the standard API Key + Secret two-string setup that almost every tool supports.

Auto-generated means you generate an RSA key pair with Bybit's official api-rsa-generator, upload the public key, keep the private key on your own machine. The RSA path's advantage is "Bybit never holds your private key" — a Bybit-side data leak doesn't leak your secret. The downside is your downstream tool has to support RSA_SHA256.

Beginners pick System-generated; experienced RSA users pick Auto-generated for the extra safety.

My Bybit key leaked — what do I do first?

First, immediately delete the key from Bybit's API Management page — this takes priority over everything else, because every minute the key stays alive is a minute of loss potential.

After deletion, check recent orders and withdrawal history (withdrawals especially, if you had Withdraw enabled by mistake). If you see any suspicious withdrawal, contact Bybit support immediately.

Finally: when creating the replacement key, figure out why the leak happened — malware, compromised SaaS vendor, accidental push to a public repo — because rotating without fixing the root cause just delays the next incident.

How does this compare to a Binance API key setup guide?

Four key differences — first, Bybit sub-account keys cannot hold Withdraw (V5 docs state it plainly); Binance sub-account keys can, and you have to remember not to tick it.

Second, unbound-IP keys on Bybit expire after 90 days, versus 30 on Binance. Third, Bybit supports RSA asymmetric signing as an advanced option. Fourth, a single Bybit UTA key can trade Spot, Contract and Options together — Binance still separates them at the API-endpoint level.

The core "don't tick Withdraw, do bind IPs" logic is identical across both. For the full Binance-specific flow, see Binance API Key Security: Complete Guide.

Get started

Ready to ship what you just learned?

Route TradingView signals into automated Bybit orders — TVSBot is non-custodial, uses your own API key, publishes backend IPs to paste into Bybit's allowlist, offers dry-run before live execution, and lets you set account-level risk controls.

Start free