Skip to content

Bitget

HaasOnline connects to Bitget (spot), Bitget USDT Futures and Bitget COIN Futures. The key needs Read-write with Manage and Trade, and it should be bound to HaasOnline's IP addresses. HaasOnline asks for three values: the API key, the secret key and the passphrase you set when creating the key.

If you don't have a Bitget account yet, sign up at Bitget.

Obtaining the API Key

Log in to Bitget, open the account menu and click API keys.

Bitget account menu with API keys.

On the API keys page, click Create API key.

Bitget API keys page with No API keys and the Create API key button.

Bitget asks which type of key to create. Choose System-generated API key. HaasOnline signs its requests with HMAC, which is what this type uses; a User-generated API key (RSA) does not work with HaasOnline.

Bitget Select API key type dialog with System-generated API key and User-generated API key.

Configure the key

Fill in the Create API key form:

  • Note: any name that identifies the key (for example HaasOnline API).
  • Passphrase (API token): a passphrase of your choice. You will enter it in HaasOnline later, so note it down now: Bitget does not show it again.
  • Permissions: choose Read-write, then under Unified trading account tick both:

    • Manage: HaasOnline reads your balances and sets leverage and position mode on futures.
    • Trade: HaasOnline places and cancels orders and reads your orders and positions.

    Leave Search (P2P) and Withdraw (Wallet) unticked. - Bind IP addresses: paste the IP addresses shown in HaasOnline (or your server's IP on a self-hosted license, see below), separated by commas. Bitget marks this optional, but a bound key can't be used from anywhere else.

Bitget Create API key form with a note, a passphrase, Read-write, Manage and Trade ticked under Unified trading account, Withdraw unticked, and bound IP addresses.

Danger

Do not tick Withdraw. HaasOnline never needs it to trade for you, and a trading-only key limits what a leaked key could do.

Info

For the IP binding:

  • On HaasOnline TradeServer Cloud, paste the addresses shown under IP addresses to whitelist in the HaasOnline account setup form (use its copy icon).
  • On a self-hosted TradeServer license, use the public IP address of your machine or server.

Classic accounts

These steps are for a Bitget Unified trading account, the default for new accounts. On an older Classic account the form lists other permissions: choose Read-write, then tick spot Trade and futures Orders and Holdings, and leave withdrawals and transfers off. HaasOnline works out which kind of key it is by itself.

Click Create.

Verify

In Security verification, enter the code Bitget emails you and your Google Authenticator verification code, then click Confirm.

Bitget Security verification dialog with the email code and Google Authenticator code.

Copy the keys

Create Succeeded shows the new key:

Bitget Create Succeeded page with the Access APIKey, SecretKey, bound IP addresses, QR code and the Manage and Trade privileges.

  • Access APIKey: starts with bg_ and goes in the HaasOnline Public key field.
  • SecretKey: goes in the HaasOnline Private key field.
  • The passphrase you typed in the form goes in the HaasOnline Passphrase field. It isn't shown on this page.

Danger

Copy the SecretKey now and keep the passphrase. If you lose either, 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.

  1. Click the + button at the bottom of the accounts list (on an empty page it reads Add account)
  2. Select Exchange account
  3. In Connect an exchange account, click Bitget
  4. Under What should this account trade?, choose Bitget for spot trading, or Bitget USDT Futures or Bitget COIN Futures 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.

    What should this account trade, with Bitget under Spot and Bitget COIN Futures and Bitget USDT Futures under Derivatives.

  5. Enter an Account name, then paste the values from Bitget:

    • Public key → the Bitget Access APIKey
    • Private key → the Bitget SecretKey
    • Passphrase → the passphrase you set when creating the key

    Bitget account setup form with the IP whitelist, account name, public key, private key and passphrase fields.

    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.

  6. Click Test keys. When the test passes, click Save account

If the test fails, check that the key is Read-write with Manage and Trade, that the passphrase is exactly the one you set, and that the bound IP addresses match the ones shown in HaasOnline. If it still fails, contact Support.