# Getting API Keys for Hyperliquid

Before creating API keys, make sure your wallet is connected to HyperLiquid and trading is activated.

***

### 1. Creating an API Key on HyperLiquid

#### Navigating to API Settings

1. Log in to [app.hyperliquid.xyz](https://app.hyperliquid.xyz/)
2. Open the **More** menu
3. Select the **API** section

#### Generating a Key

1. In the "Name" field, enter a name for the key (for example, `MoonTrader`)
2. Click **Generate**
3. Click **Authorize API Wallet**
4. Set the maximum key lifetime — **180 days**
5. Copy and save the **Private Key**

⚠️ The private key is shown only once. If you lose it, you will have to create a new API key.

#### Confirming Creation

1. Click **Authorize**
2. Confirm the action in MetaMask by clicking **Confirm**

The new key will appear in the list on the API page.

***

### 2. Connecting MoonTrader to HyperLiquid

#### Creating a License

1. Go to your personal account on the MoonTrader website
2. Create a new license for HyperLiquid: [direct link](https://account.moontrader.com/get-hl-license)
3. Copy the Activation Code from your personal account

#### Creating a Profile in the Terminal (Installing the Core locally)

1. Launch the MoonTrader terminal
2. Click **+ Add Profile**
3. In the "Launch Mode" field, leave the value **Run Both Visible Console**
4. In the "Exchange" field, select **HyperLiquid**
5. Click **+ New Licence**

#### Activating the License

Fill in the fields in the activation window:

1. **Activation Code** — paste the code from your MoonTrader personal account
2. **Wallet** — copy the wallet address from HyperLiquid (top right corner of the website)
3. **Private Key Source** — select **HyperLiquid**
4. **Private API Key** — paste the private key saved when creating the API
5. **Days Valid** — enter **180**
6. Click **Activate**

#### Connecting via MetaMask

After clicking **Activate**, a QR code will appear.

⚠️ Before clicking **Connect**, complete the following steps:

1. Open the **Permissions** section
2. Click **Enabled networks**
3. Uncheck all boxes
4. Leave only the **Arbitrum** network
5. Click **Update**

Then:

1. Open MetaMask and scan the QR code
2. Click **Connect**
3. Confirm the action by clicking **Confirm** in MetaMask

#### Completing the Setup

1. Copy the **Core Token** from your MoonTrader personal account and paste it into the corresponding field
2. Click **Add**

The profile is created. To launch the terminal, click **Start**.

***

### 3. Checking the Connection and Basic Settings

#### Checking the Connection

1. Open the **Balances** tab in the MoonTrader terminal
2. Make sure the USDC balance is displayed correctly

#### Basic Trading Settings

In the **Management** section, specify:

1. **Margin type** — Cross or Isolated
2. **Leverage** — set the desired leverage
3. In the **Manual Trading** section, select the **USDC** asset

The terminal is ready for trading.

***

### API Limits

HyperLiquid enforces limits on the number of API requests.

**Key rules:**

* Limits are tied to the account, not to a specific API key
* Initial limit after creating an address — **10,000 requests**
* The limit grows automatically: **1 request = 1 USDC** of actual trading volume (executed orders only)
* When the limit is exhausted, **1 request every 10 seconds** is available
* Order cancellations have a separate, higher limit — you can cancel orders even at zero main limit
* Additional requests can be purchased using your HyperLiquid balance

More details: [official HyperLiquid documentation](https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/rate-limits-and-user-limits)

**Monitoring limits in the terminal:**

MoonTrader displays information about spent and available API requests. To purchase additional requests:

1. Click on the API information in the terminal interface
2. Enter the number of requests you want to buy and click **Buy**
3. Scan the QR code through MetaMask
4. Confirm the transaction
