Skip to main content

Creating a Hyperliquid API Key for Crypto Trading Bots

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.

Funding the Wallet

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

  1. Visit the portfolio page: https://app.hyperliquid.xyz/portfolio
  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 (MetaMask or any other supported wallets)
  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 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.

Never share your secret key with anyone.


Hyperliquid API key creation interface

Configuring 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 the type of trading you want to do Spot or Futures.

    This 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 saved
  2. Test Connection:

    • Add trading pair
    • Check data updates
    • Verify 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.