Bybit¶
HaasOnline connects to Bybit (spot), Bybit Inverse Contracts and Bybit USDT Perpetual, and to Bybit EU spot. The key is connected to Bybit's Haas third-party application and needs Read-Write with the Unified Trading permissions.
If you don't have a Bybit account yet, sign up at Bybit.
Obtaining the API Key¶
Log in to Bybit, open the account menu at the top right and click API.

On API Management, click Create New Key.

Bybit asks which type of key to create. Choose System-generated API Keys. HaasOnline signs its requests with HMAC, which is what this type uses; Self-generated API Keys (RSA) do not work with HaasOnline.

Configure the key¶
Fill in the Create New Key form:
- API Key Usage: choose Connect to Third-Party Applications.
- Application Name: choose Haas. Bybit keeps keys bound to a third-party application valid permanently, and the form has no IP field: Bybit already whitelists the Haas app's IP addresses for these keys.
-
API Key Permissions: choose Read-Write, then under Unified Trading tick:
- Orders and Positions (Contract): HaasOnline places, changes and cancels futures orders and sets leverage and position mode.
- Trade (SPOT): HaasOnline places and cancels spot orders.
- USDC Derivatives Trading (USDC Contracts) is optional: HaasOnline doesn't trade Bybit's USDC contracts, but it does no harm.
Leave Block Trade, everything under Assets (Account Transfer, Subaccount Transfer, Convert) and ByX posts unticked.

Danger
Leave everything under Assets unticked. HaasOnline never needs to move funds to trade for you, and a trading-only key limits what a leaked key could do.
Self-hosted TradeServer
On a self-hosted TradeServer license, HaasOnline connects to Bybit from your own machine, not through the Haas app. Choose API Transaction instead of Connect to Third-Party Applications, tick the same permissions, and bind the key to the public IP address of your machine or server.
Click Submit.
Verify¶
In Security Verification, click Send Verification Code, enter the code Bybit emails you and your Google 2FA Code, then click Next Step.

Copy the keys¶
Bybit then shows the new API key and its secret:
- API key: goes in the HaasOnline Public key field.
- Secret: goes in the HaasOnline Private key field.
Danger
Copy the secret now. Bybit shows it only once. If you lose it, delete the key and create a new one.
Adding the API to HaasOnline TradeServer Cloud¶
Log in to HaasOnline TradeServer Cloud and open Exchange Accounts from the user menu in the top right. The Adding an API to the Platform guide shows these first steps with screenshots.
- Click the + button at the bottom of the accounts list (on an empty page it reads Add account)
- Select Exchange account
- In Connect an exchange account, click Bybit
-
Under What should this account trade?, choose Bybit for spot trading, or Bybit Inverse Contracts or Bybit USDT Perpetual under Derivatives, then click Continue with .... Each market is its own HaasOnline account, so repeat these steps with the same key to add another market. Bybit EU is for accounts on Bybit's EU platform: create that key on your Bybit EU account. The steps above are for bybit.com, and the EU platform's key form may differ.

-
Enter an Account name and leave API Version on Unified account (choose Standard account only if your Bybit account hasn't been upgraded to a Unified Trading Account). Then paste the values from Bybit. On Cloud with a Haas-app key, you don't need to enter IP addresses to whitelist anywhere on Bybit: the Haas app already has them. (A self-hosted API Transaction key is bound to your own server's IP, as above.)
- Public key → the Bybit
API key - Private key → the Bybit
secret

Info
Check for spaces at the start and end of each value after you paste it. Stray spaces are a common cause of a failed key test.
- Public key → the Bybit
-
Click Test keys. When the test passes, click Save account
If the test fails, check that the key is Read-Write with Orders, Positions and Trade ticked, and that API Version matches your Bybit account (Unified or Standard). If it still fails, contact Support.