Before a program can trade on Bybit you need three things in place: an API key with only the permissions it needs, a request pattern that stays inside the rate limits, and a test environment where mistakes cost nothing. This guide is based on Bybit's official V5 API documentation and Help Center, verified on 2026-09-28: where to create the key, which permissions to tick, why to bind an IP, when a key without an IP expires, the REST and WebSocket limits, Demo Trading versus Testnet, and finally what the official terms say about fees and rebates on API orders. Bind Bybit to Quant Nova with referral code NOVA888 and new users get a 30% fee rebate at Lv.1, 1.5 times the common 20% referral code, so part of the fee on every fill your strategy makes can come back to you.
Quick answers
- API keys can only be created on the website, not in the app; brand-new accounts may be blocked from creating one for the first 48 hours.
- Permissions are read-only or read-write: a futures strategy needs Contract Trade (orders, positions), a spot strategy needs Spot Trade. The Withdraw permission under Wallet (master account only) is never needed to run a strategy, so leave it unticked.
- A key with no IP bound expires after 90 days; after you change the account password, keys with no IP bound stop working 7 days later.
- Two layers of rate limits: 600 HTTP requests per 5 seconds per IP (exceed it and you are blocked for 10 minutes), plus per-UID, per-second limits for each endpoint: 10 orders/s on USDT perpetuals and 20 orders/s on spot.
- Start on Demo Trading: it mirrors mainnet prices, comes with 50,000 USDT and other simulated assets, and uses api-demo.bybit.com.
- Rebates: Bybit's Pro fee tiers do not apply to affiliate and referral users, so bound API users pay their VIP-level fees; the terms do not mention API orders separately, so whether they count is determined by the settlement records. Binding a rebate only needs your UID, never an API key.
Before you start: four official restrictions
- Website only: the Help Center states that API keys can only be created and deleted on the website, with no option in the app (How to Create Your API Key, How to Delete Your API Key).
- 48 hours for new accounts: new users may be restricted from creating API keys for the first 48 hours after registration for risk control. Bybit's example: register at 10:00 UTC on 12 May and you can create a key from 10:00 UTC on 14 May.
- US and Mainland China IPs are rejected: the integration guide says requests from IPs located in the US or Mainland China return 403 Forbidden (Integration Guidance). Pick your server region accordingly.
- Regional sites use their own domains: international accounts use
api.bybit.comorapi.bytick.com; accounts registered on the Turkey, Kazakhstan, Georgia, UAE, EEA, Indonesia, Japan or Hong Kong sites must use their own API domains.
Decide on the key type too. Bybit offers system-generated keys (HMAC), where Bybit issues the key and secret, and self-generated keys (RSA), where you create a key pair on your own machine with Bybit's RSA key generator (2048 or 4096 bits) and give Bybit only the public key, so the private key never leaves your computer (official RSA guide). Either way, Bybit's advice is the same: treat the keys like passwords.
Creating the key and choosing permissions
- Log in on the Bybit website, click the profile icon at the top right and choose API to open API Management (or go straight to
bybit.com/app/user/api-management). - Click Create New Key.
- Choose system-generated or self-generated, add a name, then set read/write, the functions to allow and the IPs to bind.
- Enter your Google Authenticator code and submit.
Save the secret the moment it is shown: the API documentation states the secret cannot be queried again through the API. The permission groups listed in the official API docs:
| Permission | What it covers | Tick it for a strategy? |
|---|---|---|
| Read-only / read-write | Read-only can only query; read-write can trade and change settings | Read-only for monitoring or bookkeeping; read-write only if it places orders |
| Contract Trade | Orders, positions | Yes for futures strategies |
| Spot Trade | Spot orders | Yes for spot strategies |
| Options | USDC options trading | Only if you trade them |
| Wallet | Account transfer, subaccount transfer, Withdraw (master only) | Transfers if needed; never Withdraw |
| Convert, Earn, etc. | Convert, Earn products | Leave off if unused |
Sources: Get API Key Information, Modify Master API Key. Subaccounts can have their own keys, created by the master account's key through an official endpoint with the same per-permission choices. One strategy per subaccount keeps limits and risk separate.
Withdraw is the most dangerous permission a key can have. Leave it off and a leaked key cannot be used to move your assets out; the same logic applies to transfer permissions you do not need.
IP binding and key expiry
When creating a key you can list the IPs allowed to call it, separated by commas; leaving it empty or entering * means no binding. The official docs state two expiry rules (Create Sub UID API Key):
- A key with no IP bound becomes invalid after 90 days.
- Once the account password is changed, keys with no IP bound become invalid after 7 days.
The key information endpoint returns deadlineDay (days remaining) and expiredAt (expiry date), which Bybit says apply only to keys with no IP bound or where the password has been changed. In practice: run the strategy on a cloud server with a fixed outbound IP and bind that IP; if you run it on a home connection with a changing IP, plan to recreate the key regularly. If every request suddenly fails authentication, check whether the key has expired before debugging your code.
Rate limits: the IP layer and the UID layer
Bybit applies two layers of limits (Rate Limit Rules, verified 2026-09-28):
- IP layer: by default each IP may send 600 HTTP requests in a 5-second window, across api.bybit.com and regional domains. Exceed it and you get "403, access too frequent"; Bybit says to close all HTTP sessions and wait at least 10 minutes, after which the ban lifts automatically. It also advises against running at the edge of the limit.
- UID layer: a rolling per-second window per UID, with a separate allowance for each endpoint. Exceed it and you get
retCode 10006, "Too many visits!". Every response carriesX-Bapi-Limit(current limit),X-Bapi-Limit-Status(remaining) andX-Bapi-Limit-Reset-Timestamp(reset time), so your code can slow itself down.
Because allowances sit on the UID, several programs under one UID share the same endpoint allowance; if you run many strategies, splitting them across subaccounts keeps them from throttling each other. Common endpoints (Unified Trading Account):
| Endpoint | Purpose | Inverse / USDT contracts | Options | Spot |
|---|---|---|---|---|
| /v5/order/create | Place order | 10/s | 10/s | 20/s |
| /v5/order/amend | Amend order | 10/s | 10/s | 10/s |
| /v5/order/cancel | Cancel order | 10/s | 10/s | 20/s |
| /v5/order/cancel-all | Cancel all | 10/s | 1/s | 20/s |
| /v5/order/create-batch | Batch orders | 10/s | 10/s | 20/s |
| /v5/order/realtime | Open orders | 50/s | ||
| /v5/position/list | Positions | 50/s | N/A | |
| /v5/account/wallet-balance | Balance | 50/s | ||
| /v5/account/fee-rate | Your fee rate | 5/s | ||
Details that are easy to miss:
- Batch endpoints have their own allowance: batch and single-order endpoints do not share limits; each batch holds 1 to 10 orders and consumes one unit per order (a batch of 5 uses 5). Orders beyond the remaining allowance in that second fail, the rest go through.
- Open order caps: perpetuals and futures allow 500 active orders and 10 conditional orders per symbol; spot allows 500 orders in total per account, including up to 30 open TP/SL orders and 30 conditional orders per symbol; options default to 50 open orders per coin (Place Order).
- Daily order totals are monitored: if the total orders across a master account and its subaccounts in one UTC day exceed a certain limit, Bybit reserves the right to remind, warn and restrict, and API users accept this by default.
- Limits can be raised: order endpoints are marked upgradable; contact your client manager or submit an application.
- Keep your clock accurate:
recv_windowdefaults to 5,000 ms and the timestamp must fall between server time minus recv_window and server time plus 1 second; Bybit recommends keeping the host NTP-synchronised.
WebSocket: market data, private streams and WS orders
Bybit's WebSocket has three parts: public market data (separate URLs for spot, USDT/USDC contracts, inverse and options), the private stream (/v5/private for orders, executions, positions and wallet), and WS order entry (/v5/trade, which does not support spread trading or Demo Trading). The connection rules (WebSocket Connect):
- Do not open more than 500 connections within 5 minutes per domain, and do not connect and disconnect frequently.
- Up to 1,000 market data connections per IP, counted separately for spot, linear, inverse and options.
- Send a ping every 20 seconds; with no ping and no data the connection is cut after 10 minutes. Private and order-entry connections can set
max_active_timebetween 30 seconds and 10 minutes. - Spot allows up to 10 args per subscription request, and one public connection cannot exceed 21,000 characters of args.
A common pattern is to receive prices and order status over WebSocket and keep REST for placing orders and periodic reconciliation, so polling does not eat your REST allowance.
Test on Demo Trading or Testnet first
Bybit has two test environments, and its FAQ spells out the differences (FAQ — Demo Trading, Testnet test coins, Demo Trading API):
| Item | Demo Trading | Testnet |
|---|---|---|
| Prices | Mirror mainnet; fills do not enter the real order book | Independent of mainnet; fills move Testnet prices |
| Account | Switch in from your mainnet account; own UID; works for subaccounts | Separate registration; PC browser only |
| Simulated funds | 50,000 USDT, 50,000 USDC, 1 BTC, 1 ETH on creation; top up when equity is below 10,000 USDT | 10,000 USDT and 1 BTC once every 24 hours |
| REST domain | api-demo.bybit.com | api-testnet.bybit.com |
| Limits | UTA spot and derivatives only; not every API is available; orders kept 7 days; fixed rate limits; data cleared after 30 days without access | Most features, but no deposits or withdrawals |
The rule of thumb: to see how a strategy reacts to real prices, use Demo Trading; to test non-trading features such as transfers, Bybit points you to Testnet. Two things to remember: demo keys are created separately inside Demo Trading, and they must connect to api-demo.bybit.com, not mainnet; the demo WebSocket only carries private streams (wss://stream-demo.bybit.com), so public data comes from mainnet's stream.bybit.com. Bybit also warns never to deposit real funds to a Testnet account, as they cannot be recovered.
A minimal example that reads the unified account balance with a demo key. Per the docs, a GET request signs timestamp + API key + recv_window + query string with HMAC-SHA256, output as lowercase hex. Keys come from environment variables, never hard-coded:
import hashlib, hmac, os, time, requests
API_KEY = os.environ["BYBIT_DEMO_KEY"] # demo key, read-only is enough
API_SECRET = os.environ["BYBIT_DEMO_SECRET"]
BASE = "https://api-demo.bybit.com"
RECV_WINDOW = "5000"
query = "accountType=UNIFIED"
ts = str(int(time.time() * 1000))
payload = ts + API_KEY + RECV_WINDOW + query
sign = hmac.new(API_SECRET.encode(), payload.encode(), hashlib.sha256).hexdigest()
r = requests.get(f"{BASE}/v5/account/wallet-balance?{query}", headers={
"X-BAPI-API-KEY": API_KEY,
"X-BAPI-TIMESTAMP": ts,
"X-BAPI-RECV-WINDOW": RECV_WINDOW,
"X-BAPI-SIGN": sign,
})
print(r.json()["retCode"], r.headers.get("X-Bapi-Limit-Status"))
Once it works, switch the domain to api.bybit.com and use a mainnet key. Demo accounts can also be topped up through the API (/v5/account/demo-apply-money, once per minute).
Fees and rebates on API orders
Fees: Bybit's fee schedule is set by VIP level and does not list a separate API rate. VIP0 is 0.02% maker / 0.055% taker on contracts and 0.1% / 0.1% on spot. A separate Pro1 to Pro6 schedule requires, on top of volume, that API trading exceed 20% of volume; but the VIP rules state "The Pro status does not apply to Affiliate and Referral users, even if their API trading volume exceeds 20%", so users bound through a referral code pay their VIP-level fees even if they trade mainly by API. Full thresholds are in Bybit VIP levels and Pro tiers. Check your actual rate with /v5/account/fee-rate.
Rebates: Bybit's Affiliate Program FAQ (official text, updated 2026-09-19) says the commission base is trading fees minus market maker rebates minus bonuses and coupons, and that users who receive a rebate, discount or incentive under another Bybit program may not contribute to affiliate commission. The terms do not exclude API orders, but they do not mention them either, so whether API-generated fees count is determined by the settlement records; accounts in Bybit's market maker program should check first. The same FAQ says the referral relationship may be terminated if a referred user makes no trades for 180 consecutive days, which matters for strategies that sit idle for months.
Quant Nova's Bybit rebate is 30% at Lv.1 for new users, 35% at SVIP (reachable by volume), and up to 40% at the invite-only Supernova level. At a typical quant size: 5 million USDT of monthly futures volume, all taker, is about 2,750 USDT in fees, which reaches Lv.5 (2,500 USDT of fees in 30 days) at 34%, or about 935 USDT back each month; a common 20% code returns 550 USDT. See the Bybit fee rebate guide, adding a referral code within 14 days of sign-up, and fee rebates for quant traders.
If you are already a VIP on another exchange or trade large volume, contact Quant Nova support: we work directly with the exchange's official team to help you obtain benefits such as a VIP level trial, subject to the exchange's approval.