Skip to main content
POST
Import Lighter Credentials
Import existing Lighter API credentials for a wallet. This endpoint is used when delegation or server wallet generation is not possible, allowing users to provide their own pre-generated API keys from the Lighter platform.
The imported credentials will be securely linked to the authenticated user account. Never share your API private keys.

Features

  • Credential Import: Link existing Lighter API keys to your HyperDEX account
  • Secure Storage: Credentials are encrypted and stored securely
  • Flexible Wallet Linking: Use wallet address or internal wallet ID

When to Use

Use this endpoint when:
  • You already have Lighter API credentials generated from the Lighter platform
  • Server-side wallet delegation is not available
  • You want to use your existing Lighter account with HyperDEX

Request

  • Method: POST
  • Endpoint: /api/trading/lighter/import
  • Authentication: Required (JWT Bearer token)

Headers

Request Body

Request Parameters

Example Request

Success Response

Response Fields

Error Responses

400 Bad Request - Missing Parameters

401 Unauthorized - Missing Token

500 Internal Server Error - Wallet Not Found

How to Get Lighter Credentials

  1. Visit Lighter DEX and create an account
  2. Navigate to your account settings
  3. Generate API keys from the dashboard
  4. Note down your:
    • accountIndex - Your Lighter account index
    • apiKeyIndex - The API key index
    • apiPublicKey - Your API public key
    • apiPrivateKey - Your API private key
After importing credentials, you can use the standard trading endpoints to place orders on Lighter without providing credentials as query parameters.
If you don’t have existing Lighter credentials, you can generate them directly on the Lighter platform and then import them using this endpoint.

Authorizations

Authorization
string
header
required

JWT token for authentication. Required for smart order execution.

Body

application/json
walletIdOrAddress
string
required

The wallet address or internal wallet ID associated with these credentials

Example:

"0xA5BD439c4d4Fc7cA8B14A9FE77fd5C4FFd7e4996"

accountIndex
integer
required

The Lighter account index (usually 0 or 1)

Example:

0

apiKeyIndex
integer
required

The index of the API key being imported

Example:

10

apiPublicKey
string
required

The public key of the API key pair

Example:

"0x..."

apiPrivateKey
string
required

The private key of the API key pair

Example:

"0x..."

Response

Credentials imported successfully

success
boolean
Example:

true

message
string
Example:

"Lighter credentials imported successfully"

timestamp
integer

Unix timestamp in milliseconds