Skip to main content

How to Create a Hyperliquid API Key for Your Bot

This guide walks you through setting up API access for Hyperliquid, a decentralized exchange. The process requires creating and funding a Hyperliquid protocol wallet before configuring your trading bot.

Info

An API (Application Programming Interface) key for a decentralized exchange (DEX) like Hyperliquid allows your trading bot to interact with the protocol programmatically. Unlike centralized exchanges, this often involves authorizing actions through your connected wallet.

Funding the Wallet​

Before using Hyperliquid with Gunbot, you must connect your wallet and fund it:

  1. Visit the Hyperliquid portfolio page.
  2. Click the Connect button in the center of the page, or use the Connect option in the top menu bar.
  3. Select your wallet (e.g., MetaMask or any other supported wallet).
  4. Approve the connection in your wallet popup.

Hyperliquid portfolio connect screen

  1. In the Deposit tab:
    • Choose a deposit chain from the dropdown list:
      • Arbitrum One (recommended – lowest gas fees and fastest confirmation)
      • Ethereum (Only ETH Deposits)
      • Bitcoin (Only BTC Deposits)
    • Select USDC as the deposit token.
    • Enter the desired amount.
    • Click the Deposit button.
    • Confirm the transaction in your wallet.

Hyperliquid Deposit blockchains available

Once funds are deposited, you’re ready to generate your API credentials.


Creating Hyperliquid API Credentials​

  1. In the top menu, go to More > API.
  2. Enter a name for your key (e.g., Gunbot).
  3. Paste your wallet address.
  4. Click Generate, then Authorize API Wallet.
  5. Save your public API key and secret securely.
Important

Never share your secret key with anyone.


Hyperliquid API key creation interface

Configuring Your Trading Bot​

Set up your bot directly in the GUI using your Hyperliquid credentials:

  1. Access Settings: Open the bot’s Exchange configuration section.
  2. Select Market Type: Choose "spot" or "swap" depending on whether you want to do Spot or Futures trading.
    Info

    This market type should be selected first and usually remains unchanged once set.

  3. Enter Credentials:
    • API Key: Your Hyperliquid public API key.
    • API Secret: Your generated secret key.
    • Origin Wallet: The wallet address you connected to Hyperliquid.
    • Verify all details carefully.
  4. Save Exchange: Confirm your exchange setup and proceed to Trading Settings.

Hyperliquid API key configuration in Gunbot GUI

Verification Steps​

Complete these final checks:

  1. Save Configuration:

    • Verify all API settings.
    • Confirm credentials are saved.
  2. Test Connection:

    • Add a trading pair.
    • Check for data updates.
    • Verify your account balance.
    • Monitor initial operations.

A properly configured API ensures reliable automated trading operations. Regular reviews of your API settings help maintain account security. Remember to never share your API credentials and always use secure channels when setting up your trading bot.