Account
Register API Key
Register API keys with exchanges to enable trading operations. Links server wallet to exchange accounts.
POST
Register API keys with exchanges to enable trading operations. This endpoint links your server wallet to exchange accounts and generates the necessary credentials.
See the Place Order documentation for more details.
Features
- Multi-exchange support: Generate API keys for Aster and Hyperliquid
- Wallet-based registration: Link API keys to server wallets
- Secure storage: API credentials are encrypted and stored securely
- Automatic signing: Server handles message signing for authentication
Supported Exchanges
| Exchange | Endpoint | Notes |
|---|---|---|
| Aster | POST /api/trading/aster/apikey | Generates API key and secret |
| Hyperliquid | POST /api/trading/hyperliquid/apikey | Creates API wallet with expiry |
| Lighter | N/A | Use Lighter platform directly |
Lighter DEX: You do NOT register API keys through HyperDEX for Lighter. Instead, create an account on Lighter DEX, deposit funds, and generate API keys from their platform. Provide these credentials as query parameters when placing orders.
Aster API Key Registration
Register your server wallet with Aster exchange to get API credentials.Endpoint
POST /api/trading/aster/apikey
Request Body
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
walletIdOrAddress | string | Yes | Can be userId, walletId (UUID), or wallet address (0x…) |
Example Request
What Happens
- Server retrieves the wallet using the provided identifier
- Server signs a message using the wallet’s MPC key shares
- Aster verifies the signature to authenticate the wallet
- Aster returns API key and secret
- API credentials are encrypted and stored in the database
Success Response
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation status |
message | string | Success message |
data.signerAddress | string | Wallet address registered with Aster |
data.createdAt | string | ISO timestamp of registration |
timestamp | number | Unix timestamp in milliseconds |
Hyperliquid API Key Registration
Register your server wallet with Hyperliquid exchange to create an API wallet.Endpoint
POST /api/trading/hyperliquid/apikey
Request Body
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
walletIdOrAddress | string | Yes | Can be userId, walletId (UUID), or wallet address (0x…) |
Example Request
What Happens
- Server creates a new API wallet for Hyperliquid
- Server signs an agent approval message
- Hyperliquid verifies and approves the API wallet
- API wallet credentials are encrypted and stored
Success Response
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation status |
data.apiWalletAddress | string | Generated API wallet address |
data.apiPrivateKey | string | API wallet private key (encrypted in storage) |
data.mainWalletAddress | string | Main server wallet address |
data.expiryTimestamp | number | API key expiration timestamp (Unix ms) |
timestamp | number | Unix timestamp in milliseconds |
Lighter API Key Registration
How to Get Lighter API Keys
- Create Account: Visit Lighter DEX and create an account
- Deposit Funds: Deposit USDC directly on the Lighter platform
- Generate API Keys: Navigate to your account settings and generate API keys
- Note Credentials: Save your:
apiKeyPrivateKey- Your API key private key (hex format)apiKeyIndex- API key index numberaccountIndex- Your Lighter account index
Using Lighter API Keys
When placing orders on Lighter through HyperDEX, provide these credentials as query parameters:Error Responses
400 Bad Request - Missing Parameters
404 Not Found - Wallet Not Found
409 Conflict - Key Already Exists
500 Internal Server Error
Use Cases
- Initial account setup for trading on Aster and Hyperliquid
- Link server wallets to exchange accounts
- Enable automated trading through API credentials
- Secure multi-exchange trading setup
Important Notes
Prerequisites: You must create a server wallet using
POST /api/wallets before registering API keys.Lighter Integration: For Lighter DEX, create your account and generate API keys directly on their platform. Then provide those credentials as query parameters when placing orders through HyperDEX.
Authorizations
Path Parameters
Exchange adapter name (aster or hyperliquid). Note: Lighter requires direct platform registration.
Available options:
hyperliquid, aster Body
application/json
Can be userId, walletId (UUID), or wallet address (0x...)